linux boost filesystem程序链接,c-在Ubuntu 13.04上链接boost :: filesystem

我正在尝试在Ubuntu 13.04上链接一个项目到boost:filesystem,并且在最后阶段遇到了一些奇怪的链接错误.

构建配置通过cmake完成:

find_package(Boost COMPONENTS system filesystem program_options REQUIRED )

include_directories(${Boost_INCLUDE_DIR})

link_directories(${Boost_LIBRARY_DIR})

target_link_libraries(${YARS_TARGET} yarsLib GLEW GL GLU glut m dl xerces-c ode ${Boost_LIBRARIES})

我尝试使用其他Boost版本.对于1.49和1.53,我的行为相同.

在Ubuntu 12.04上,它可以正常工作,而在运行带有boost 1.53的Archlinux的开发机器上,它可以编译,链接和运行.

/usr/bin/g++ -O3 CMakeFiles/yars.dir/yarsMain.o -o ../bin/yars

-L/home/vagrant/local/lib -rdynamic ../lib/libyarsLib.a -lGLEW -lGL -lGLU

-lglut -lm -ldl -lxerces-c -lode -lboost_system

-lboost_filesystem -lboost_program_options

../lib/libsensorLib.a ../lib/libenvironmentLib.a ../lib/libutilLib.a ../lib/libutilFilterLib.a ../lib/libutilFormatLib.a ../lib/libutilFunctionGeneratorLib.a ../lib/libutilIoLib.a ../lib/libutilMathLib.a ../lib/libutilDefineLib.a ../lib/libdescriptionLib.a ../lib/libfilterDescriptionLib.a ../lib/libfunctionGeneratorDescriptionLib.a ../lib/libfunctionGeneratorDescriptionUtilLib.a ../lib/libbioDescriptionLib.a ../lib/libsensorsDescriptionLib.a ../lib/libyarsDirectoriesModel.a -Wl,-rpath,/home/vagrant/local/lib:

../lib/libutilIoLib.a(FileSystemOperations.o):

In function `FileSystemOperations::doesDirExist(boost::filesystem::path)':

FileSystemOperations.cpp:(.text+0x27): undefined reference to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'

FileSystemOperations.cpp:(.text+0x3a): undefined reference to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'

../lib/libutilIoLib.a(FileSystemOperations.o): In function `FileSystemOperations::doesFileExist(boost::filesystem::path)':

FileSystemOperations.cpp:(.text+0x67): undefined reference to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'

FileSystemOperations.cpp:(.text+0x7a): undefined reference to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'

../lib/libutilIoLib.a(FileSystemOperations.o): In function `FileSystemOperations::doesDirExist(std::string*)':

FileSystemOperations.cpp:(.text+0xca): undefined reference to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'

../lib/libutilIoLib.a(FileSystemOperations.o):FileSystemOperations.cpp:(.text+0xdf): more undefined references to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)' follow

../lib/libutilIoLib.a(FileSystemOperations.o): In function `FileSystemOperations::getFirstExistingDirContainingDir(std::vector<:string std::allocator> >, std::string*)':

FileSystemOperations.cpp:(.text+0x2c3): undefined reference to `boost::filesystem::path::root_directory() const'

FileSystemOperations.cpp:(.text+0x35e): undefined reference to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'

FileSystemOperations.cpp:(.text+0x373): undefined reference to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'

FileSystemOperations.cpp:(.text+0x403): undefined reference to `boost::filesystem::path::operator/=(boost::filesystem::path const&)'

FileSystemOperations.cpp:(.text+0x43b): undefined reference to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'

FileSystemOperations.cpp:(.text+0x453): undefined reference to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'

FileSystemOperations.cpp:(.text+0x50d): undefined reference to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'

FileSystemOperations.cpp:(.text+0x564): undefined reference to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'

../lib/libutilIoLib.a(FileSystemOperations.o): In function `FileSystemOperations::getFirstExistingDirContainingFile(std::vector<:string std::allocator> >, std::string*)':

FileSystemOperations.cpp:(.text+0x7e3): undefined reference to `boost::filesystem::path::root_directory() const'

FileSystemOperations.cpp:(.text+0x87e): undefined reference to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'

FileSystemOperations.cpp:(.text+0x893): undefined reference to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'

FileSystemOperations.cpp:(.text+0x923): undefined reference to `boost::filesystem::path::operator/=(boost::filesystem::path const&)'

FileSystemOperations.cpp:(.text+0x95b): undefined reference to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'

FileSystemOperations.cpp:(.text+0x973): undefined reference to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'

FileSystemOperations.cpp:(.text+0xa2d): undefined reference to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'

FileSystemOperations.cpp:(.text+0xa84): undefined reference to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'

../lib/libutilIoLib.a(FileSystemOperations.o): In function `FileSystemOperations::getFirstExistingDir(std::vector<:string std::allocator> >)':

FileSystemOperations.cpp:(.text+0xd53): undefined reference to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'

../lib/libutilIoLib.a(FileSystemOperations.o):FileSystemOperations.cpp:(.text+0xd68): more undefined references to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)' follow

../lib/libutilIoLib.a(FileSystemOperations.o): In function `FileSystemOperations::checkValidPath(std::string*, bool, bool, std::string)':

FileSystemOperations.cpp:(.text+0x1100): undefined reference to `boost::filesystem::detail::initial_path(boost::system::error_code*)'

FileSystemOperations.cpp:(.text+0x1124): undefined reference to `boost::filesystem::path::operator/=(boost::filesystem::path const&)'

FileSystemOperations.cpp:(.text+0x11e9): undefined reference to `boost::filesystem::path::root_directory() const'

FileSystemOperations.cpp:(.text+0x1237): undefined reference to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'

FileSystemOperations.cpp:(.text+0x130a): undefined reference to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'

FileSystemOperations.cpp:(.text+0x131f): undefined reference to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'

FileSystemOperations.cpp:(.text+0x137b): undefined reference to `boost::filesystem::detail::system_complete(boost::filesystem::path const&, boost::system::error_code*)'

FileSystemOperations.cpp:(.text+0x13dc): undefined reference to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'

../lib/libutilIoLib.a(FileSystemOperations.o): In function `FileSystemOperations::checkValidPathFromAlternatives(std::string*, std::string*, std::vector<:string std::allocator> >*, bool, std::string)':

FileSystemOperations.cpp:(.text+0x1635): undefined reference to `boost::filesystem::path::root_directory() const'

FileSystemOperations.cpp:(.text+0x1699): undefined reference to `boost::filesystem::path::operator/=(boost::filesystem::path const&)'

FileSystemOperations.cpp:(.text+0x16d0): undefined reference to `boost::filesystem::detail::system_complete(boost::filesystem::path const&, boost::system::error_code*)'

FileSystemOperations.cpp:(.text+0x173f): undefined reference to `boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'

collect2: error: ld returned 1 exit status

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值