Boost logo

Boost :

Subject: [boost] [filesystem] Link errors on Linux/MacOS with v3
From: cheesy4poofs (cheesy4poofs_at_[hidden])
Date: 2010-09-20 20:34:23


I've gone thru the exercise of converting all our code to use filesystem v3.
Everything worked fine on Windows, but when I tried to compile on Linux and
Mac, I get link errors with gcc. I have set my compiler flags to
-DBOOST_FILESYSTEM_VERSION=3 and everything compiles fine.

All the link errors come from filesystem3:

../NwUtils/libNwUtils.a(FileStream.cpp.o): In function
`boost::filesystem3::path& boost::filesystem3::path::append<char [12]>(char
const (&) [12], std::codecvt<wchar_t, char, __mbstate_t> const&)':
FileStream.cpp:(.text._ZN5boost11filesystem34path6appendIA12_cEERS1_RKT_RKSt
7codecvtIwc11__mbstate_tE[boost::filesystem3::path&
boost::filesystem3::path::append<char [12]>(char const (&) [12],
std::codecvt<wchar_t, char, __mbstate_t> const&)]+0x30): undefined reference
to `boost::filesystem3::path::m_append_separator_if_needed()'
FileStream.cpp:(.text._ZN5boost11filesystem34path6appendIA12_cEERS1_RKT_RKSt
7codecvtIwc11__mbstate_tE[boost::filesystem3::path&
boost::filesystem3::path::append<char [12]>(char const (&) [12],
std::codecvt<wchar_t, char, __mbstate_t> const&)]+0x59): undefined reference
to `boost::filesystem3::path::m_erase_redundant_separator(unsigned long)'

Am I supposed to compile boost with a different setting to use filesystem
v3? I didn't do anything special on windows. When I attempt to build boost
on Mac/Linux with -DBOOST_FILESYSTEM_VERSION=3, the boost build fails with
errors about BOOST_FILESYSTEM_VERSION != 2.

Any help would be greatly appreciated as I'm at my wit's end!

Thanks,
Scott


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk