c++ - link error when using boost library on MacOSX -
I have created an XCode project and I have added the header search path to "/ opt / local / include / boost" and referenced from "
boost :: system :: get_generic_category ()": __static_initialization_and_destruction_0 ( Main.o in main.o __static_initialization_and_destruction_0 (int, int) in main.o __static_initialization_and_destruction_0 (int, int) in main.o
and in my / opt / local / lib, I know this (I think Boost.System Library):
-rw-r - r-- Root Administrator 80600 23 Jul 16:31 libboost_system-mt.a -rwxr-xr-x 2 root administrator 30988 23 Jul 16: 30 libboost_system-mt.dylib *
Can you please tell me What am I missing?
The library is not enough to add the path. It ensures that whenever you ask it to link it to a library, it will search for that library as the specified path, as well as all the default paths.
So you actually get the compiler to flag Need to link to the library with
-lboost_system-mt on Windows, boost default Supports auto-linking - that is, if you include the right headers now, then it will also try to link to the actual libraries (using #magicon # pragma). On other platforms, you have to manually link to the library.