boost::filesystem3::path::codecvt() undefined reference
Tryin开发者_高级运维g to use boost filesystem 3, but when I link I get the following undefined reference:
../myfile-g.o: In function `boost::filesystem3::path::codecvt()':
../boost/filesystem/v3/path.hpp:377: undefined reference to
`boost::filesystem3::path::wchar_t_codecvt_facet()'
I grep'd everywhere in boost and there is no wchar_t_codecvt_facet()
Where is this defined?
Thanks
Perhaps you are missing a linked library? When I grep for it I get:
filesystem/v3/path.hpp:371 return *wchat_t_codecvt_facet();
filesystem/v3/path.hpp:462 static const codecvt_type *& wchar_t_codecvt_facet();
This is with boost 1.44 on macosx. Since the function is defined in the header file it should be part of libboost_filesystem . I'm not sure what compiler / linker you are using but the flag -libboost_filesystem
will work if boost is properly on your path and you are using g++.
Try adding -lboost_filesystem
for the newer versions of boost library.
精彩评论