Boost logo

Boost Users :

Subject: Re: [Boost-users] invalid conversion from 'bool
From: Nathan Ridge (zeratul976_at_[hidden])
Date: 2011-07-19 02:30:25


> Thanks your reply, but how to (link against the boost filesystem & system lib)? I am on linux/g++
> these are errors I got, after I eliminate native
> ----------------
> eric_at_eric-laptop:~/cppcookbook/ch10$ g++ -lboost_system Example10-10.cpp
> /tmp/ccF2cJsO.o: In function `boost::filesystem3::path::codecvt()':
> Example10-10.cpp:(.text._ZN5boost11filesystem34path7codecvtEv[boost::filesystem3::path::codecvt()]+0x7): undefined reference to `boost::filesystem3::path::wchar_t_codecvt_facet()'
> /tmp/ccF2cJsO.o: In function `boost::filesystem3::complete(boost::filesystem3::path const&)':
> Example10-10.cpp:(.text._ZN5boost11filesystem38completeERKNS0_4pathE[boost::filesystem3::complete(boost::filesystem3::path const&)]+0x2d): undefined reference to `boost::filesystem3::absolute(boost::filesystem3::path const&, boost::filesystem3::path const&)'
> /tmp/ccF2cJsO.o: In function `boost::filesystem3::copy_file(boost::filesystem3::path const&, boost::filesystem3::path const&)':
> Example10-10.cpp:(.text._ZN5boost11filesystem39copy_fileERKNS0_4pathES3_[boost::filesystem3::copy_file(boost::filesystem3::path const&, boost::filesystem3::path const&)]+0x24): undefined reference to `boost::filesystem3::detail::copy_file(boost::filesystem3::path const&, boost::filesystem3::path const&, boost::filesystem3::copy_option::enum_type, boost::system::error_code*)'
> /tmp/ccF2cJsO.o: In function `boost::filesystem3::initial_path()':
> Example10-10.cpp:(.text._ZN5boost11filesystem312initial_pathEv[boost::filesystem3::initial_path()]+0x18): undefined reference to `boost::filesystem3::detail::initial_path(boost::system::error_code*)'
> collect2: ld returned 1 exit status
> eric_at_eric-laptop:~/cppcookbook/ch10$
> -------------------
> looking to see any expert's help again and thank a lot in advance, Eric

You need to link to Boost.Filesystem as well as Boost.System.
 
That is, in addition to -lboost_system, you should be passing
-lboost_filesystem to the compiler.
 
Regards,
Nate.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net