Boost logo

Boost Users :

From: Vladimir Prus (vladimir_at_[hidden])
Date: 2008-08-23 15:10:33


Graham Bull wrote:

> It compiles fine, and I can get it to link to use the shared object:
>
> g++ -I/usr/local/include/boost-1_35 -o test test.cpp
> -lboost_filesystem-gcc42-mt-1_35
>
> But I want to statically link instead. I've tried this and other
> similar combinations:
>
> g++ -I/usr/local/include/boost-1_35 -o test test.cpp
> -lboost_filesystem-gcc42-mt-s-1_35 -static -static-libgcc
>
> and I'm always getting these linker errors:
>
> /tmp/ccoiFv2v.o: In function
> `__static_initialization_and_destruction_0(int, int)':
> test.cpp:(.text+0x1dc): undefined reference to
> `boost::system::get_system_category()'

Presumably, if you have underfined references to symbols of Boost.System
library, you need to link to that library?

(This does not matter for shared linking, since shared Boost.Filesystem
library refers to Boost.System library, but no such 'reference' mechanism
exists for static libraries).

- Volodya


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net