Hello,
I can't link against the filesystem library.
When I try to compile a program using boost::filesystem (like the simple
one attached to this email), I get "undefined reference" errors from the
linker:
dourak@Vvardenfell:~$ g++ -o dummy dummy.cpp -lboost_filesystem
-lboost_system
/tmp/ccMpl6cj.o: In function
`boost::filesystem::exists(boost::filesystem::path const&)':
dummy.cpp:(.text._ZN5boost10filesystem6existsERKNS0_4pathE[boost::filesystem::exists(boost::filesystem::path
const&)]+0x19): undefined reference to
`boost::filesystem::detail::status(boost::filesystem::path const&,
boost::system::error_code*)'
/tmp/ccMpl6cj.o: In function `boost::filesystem::path::path(char*
const&,
boost::enable_if::type>,
void>::type*)':
dummy.cpp:(.text._ZN5boost10filesystem4pathC2IPcEERKT_PNS_9enable_ifINS0_11path_traits11is_pathableINS_5decayIS4_E4typeEEEvE4typeE[_ZN5boost10filesystem4pathC5IPcEERKT_PNS_9enable_ifINS0_11path_traits11is_pathableINS_5decayIS4_E4typeEEEvE4typeE]+0x22):
undefined reference to `boost::filesystem::path::codecvt()'
collect2: ld a retourné 1 code d'état d'exécution
I carefully sorted the libraries in the command line, since gcc has trouble
with library dependencies, sometimes, but it still doesn't work.
I use gcc 4.6.3 on Ubuntu 12.04 64bits. The problem occurs either with
boost 1.46.1 (taken from the repositories) or with 1.50.0 (installed with
bjam).
Any hint ?
Thibaut Lepage