I have some static library. for example libpuchuu.a it depends on dynamic library. for example libSDL.so (but of cource I have libSDL.a) Creation of libpuchuu.a is simple:
ar -rcs object_file_1.o object_file_2.o
But I can't link my project with libpuchuu.a! undefined references attack my console!
At some forum I have found such sentence: all dependences of static library is in this library if your object files depends on y.a you must unpack(ar) y.a object files to your folder, then pack all objects to your new library. Questions:
- is it true?
- if it is true: object file puchuu.o depends on libSDL.a how to make libpuchuu.a?
- another solution?
PS
I have made a simple example and posted it to pastebin:
http://paste.lisp.org/display/115456
building commands:
g++ -O3 -c index.cpp -I/usr/local/include/SDL
g++ -O3 -c lib.cpp -I/usr/local/include/SDL
ar rv libpuchuu.a lib.o
g++ -O3 -o program.exe index.o -L/usr/local/lib -lmingw32 -lSDLmain -lSDL -mwindows -lSDL_image -L. -lpuchuu
... undefined references from index.cpp!