static linkage of filesystem lib under linux
Hello,
We have problems with using the static filesystem lib under linux.
We use filesystem as static library in a shard library.
Example:
libfilesystem.a used for shared library libTestBoostStatic.so
No errors during build of library libTestBoostStatic.so.
Afterwards we use libtest.so in the application UseTestBoostStatic.
During the linking of the application we get the following error message:
Invoking: GCC C++ Linker
g++ -L/home/ROSENINSPECTION/AlKeller/src/SDES/Test/TestBoostStatic/Debug -L/usr/lib64 -Wl,-static -lboost_filesystem-mt -lboost_regex-mt -Wl,-call_shared -o"UseTestBoostStatic" ./UseTestBoostStatic.o -lTestBoostStatic
/home/ROSENINSPECTION/AlKeller/src/SDES/Test/TestBoostStatic/Debug/libTestBoostStatic.so: undefined reference to `boost::filesystem::detail::dir_itr_increment(void*&, void*&, std::basic_string
Ottmar Buennemeyer wrote:
Hello,
We have problems with using the static filesystem lib under linux.
We use filesystem as static library in a shard library. Example: libfilesystem.a used for shared library libTestBoostStatic.so
No errors during build of library libTestBoostStatic.so.
Afterwards we use libtest.so in the application UseTestBoostStatic. During the linking of the application we get the following error message:
Invoking: GCC C++ Linker g++ -L/home/ROSENINSPECTION/AlKeller/src/SDES/Test/TestBoostStatic/Debug -L/usr/lib64 -Wl,-static -lboost_filesystem-mt -lboost_regex-mt -Wl,-call_shared -o"UseTestBoostStatic" ./UseTestBoostStatic.o -lTestBoostStatic /home/ROSENINSPECTION/AlKeller/src/SDES/Test/TestBoostStatic/Debug/libTestBoostStatic.so: undefined reference to `boost::filesystem::detail::dir_itr_increment(void*&, void*&,
...
What's wrong with our configuration?
It's impossible to say for sure, as you did not provide the exact linker lines for the library and the application. You also did not say where the unresolved function is used. The most likely reason is wrong order of parameters when linking the application. You should have: g++ -o libTestBoostStatic.so .... a.o b.o c.o -lboost_filesystem That is, -lboost_filesystem should be after all object files. - Volodya
participants (2)
-
Ottmar Buennemeyer
-
Vladimir Prus