Question

I'm building a shared library with GCC 4.5.2 and Boost 1.46.1 (compiled with --build-type=complete) and this is a command from Makefile which does the linkage part:

$(CXX) -static -lboost_filesystem -fpic -shared $^ -o $@

Everything compiles fine but I get the following error when it gets loaded by application:

plugins/crashdetect.so: undefined symbol: _ZN5boost11filesystem34path21wchar_t_codecvt_facetEv

lddoutputs:

linux-gate.so.1 =>  (0x002f8000)
libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0x00bf5000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0x0032d000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0x00506000)
/lib/ld-linux.so.2 (0x006f6000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0x00110000)

I beleive this means that it linked Boost statically.

This is what nm crashdetect.so -u | grep boost says:

 U _ZN5boost11filesystem34path21wchar_t_codecvt_facetEv
 U _ZN5boost11filesystem36detail13dir_itr_closeERPvS3_
 U _ZN5boost11filesystem36detail28directory_iterator_constructERNS0_18directory_iteratorERKNS0_4pathEPNS_6system10error_codeE
 U _ZN5boost11filesystem36detail28directory_iterator_incrementERNS0_18directory_iteratorEPNS_6system10error_codeE
 U _ZN5boost11filesystem36detail6statusERKNS0_4pathEPNS_6system10error_codeE
 U _ZN5boost6system15system_categoryEv
 U _ZN5boost6system16generic_categoryEv
 U _ZNK5boost11filesystem315directory_entry12m_get_statusEPNS_6system10error_codeE

So I think since that symbol goes first in this list then most likely there's nothing special about it.

Am I missing something?

EDIT: So is this impossible or what?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top