I’ve written some code (static library) in c++, with (i think so, C compatiblity – got ‘extern C’ and so on), and then i wanted to use it in my C application.
When im runing my C app, i got error:
undefined symbol: _ZTISt9exception
c++ code was compiled with gcc with : -std=c++0x -lstdc++ flags
then, on obj files i run ar
i suppose that symbol comes direct from c++ library. When im compiling my C app I of course add my C++ lib in my makefile, and compilation finishes with no error.
What might be wrong ?
thx for all help
A static library is not linked, it is just a collection of object files in an archive. All files names like
libxxx.aare static libraries, while files named likelibyyy.soare dynamic libraries.This means that the the external symbols in your library are never resolved until you link with it to make an executable. Then you need all the library files needed by your library as well.