[filesystem] Link errors on Linux/MacOS with v3

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

On Mon, Sep 20, 2010 at 8:34 PM, cheesy4poofs <cheesy4poofs@cox.net> wrote:
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:
...
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.
Other than defining BOOST_FILESYSTEM_VERSION as 3, you shouldn't have to do anything special.
Any help would be greatly appreciated as I'm at my wit's end!
Let's concentrate on Linux rather than the Mac, since I've got Ubuntu running under VirtualBox here. First, some basics: * What version of GCC are you running? * Are you running Boost 1.44 or svn trunk? * How are you building? Are you using bjam? * If you cd to libs/filesystem/test, and run "bjam" (without any arguments), what happens? --Beman

... When I attempt to build boost on Mac/Linux with -DBOOST_FILESYSTEM_VERSION=3 ...
Whoa! That may be the problem. When you compile your program it needs -DBOOST_FILESYSTEM_VERSION=3, but when you compile that boost libraries, you should not define anything special. What does the bjam command you are using for building the boost libraries look like? --Beman
participants (2)
-
Beman Dawes
-
cheesy4poofs