Hi!
I want to create a static archive file (written in C++) which contains a few functions which can be used in other projects. I created a cpp file (Lib.cpp) which contains the implementations of the functions and a header file (Lib.h) which contains the proto types.
Than I compiled the Library with the following commands:
gcc -I./ -c Lib.cpp
libtool -o libLibrary.a Lib.o
The first command creates Lib.o, which is converted into a static library with the second command. If a call nm libLibrary.a all of my functions are displayed, which means that they are stored within my library file. But despite of that I can not use them within an other project. For instance, I have written a file called Main.cpp, which uses the headerfile of my library and which is linked with my static archive file:
gcc -I./ -L./ -lLibrary Main.cpp
The compiler and linker find my library file, but the linker displays that all my functions are undefined. But that is not the case! They should be stored within my library!
The same project compiles under Linux without any troubles. I also tried g++ instead gcc, but that did not change anything.
Can anybody help me?
Thanks in advance
rgds
I want to create a static archive file (written in C++) which contains a few functions which can be used in other projects. I created a cpp file (Lib.cpp) which contains the implementations of the functions and a header file (Lib.h) which contains the proto types.
Than I compiled the Library with the following commands:
gcc -I./ -c Lib.cpp
libtool -o libLibrary.a Lib.o
The first command creates Lib.o, which is converted into a static library with the second command. If a call nm libLibrary.a all of my functions are displayed, which means that they are stored within my library file. But despite of that I can not use them within an other project. For instance, I have written a file called Main.cpp, which uses the headerfile of my library and which is linked with my static archive file:
gcc -I./ -L./ -lLibrary Main.cpp
The compiler and linker find my library file, but the linker displays that all my functions are undefined. But that is not the case! They should be stored within my library!
The same project compiles under Linux without any troubles. I also tried g++ instead gcc, but that did not change anything.
Can anybody help me?
Thanks in advance
rgds