Problem with Boost.Filesystem

I am trying to use functions from the boost :: file system to change the current working directory (and create it if necessary). I get binding errors:

SBDir.cpp:(.text+0x23): undefined reference to `boost::system::generic_category()'
SBDir.cpp:(.text+0x2f): undefined reference to `boost::system::generic_category()'
SBDir.cpp:(.text+0x3b): undefined reference to `boost::system::system_category()'

But am I referring to boost libraries?!? I am using the following:

-lboost_system -lboost_system-mt -lboost_filesystem -lboost_filesystem-mt

And I know that he can find them, because with -Wl, -tI get:

-lboost_system (/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libboost_system.so)
-lboost_system-mt (/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libboost_system-mt.so)
-lboost_filesystem (/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libboost_filesystem.so)
-lboost_filesystem-mt (/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/libboost_filesystem-mt.so)

FWIW: I am using gcc Ubuntu 4.4.3-4ubuntu54.4.3.

+3
source share
2 answers

Therefore, I could not understand what went wrong - therefore, I tried to disable the Ubuntu enhancement package and create it from scratch. I updated to 1.45.0 and now all the links. Not sure if this was a problem with the version or not, but if I find out in more detail, I will come back and update.

+1

boost 1.46 ( Ubuntu 11.10), -lboost_system, 11.04 1.42. , , , , , .

+2

Source: https://habr.com/ru/post/1791248/


All Articles