【发布时间】:2013-04-23 01:23:16
【问题描述】:
我从http://dl.mongodb.org/dl/cxx-driver 下载了最新的代码,并将其编译为 Ubuntu 12.04 和 12.10 上的静态库。 我的 GCC 是 4.7,并使用 CMake 作为构建系统。 Boost 库:Ubuntu 12.04 上为 1.48,Ubuntu 12.10 上为 1.49。
然后,我的两个项目使用mongodb客户端库编译成功,但是第三个项目出现以下链接错误:
Linking CXX executable cml_cloud
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../lib/libmongoclient.a(log.o):在函数mongo::LoggingManager::start(std::string const&, bool)':
log.cpp:(.text._ZN5mongo14LoggingManager5startERKSsb[_ZN5mongo14LoggingManager5startERKSsb]+0x4c): undefined reference toboost::filesystem3 ::detail::status(boost::filesystem3::path const&, boost::system::error_code*)'
log.cpp:(.text._ZN5mongo14LoggingManager5startERKSsb[_ZN5mongo14LoggingManager5startERKSsb]+0x86): 未定义引用boost::filesystem3::detail::status(boost::filesystem3::path const&, boost::system::error_code*)'
log.cpp:(.text._ZN5mongo14LoggingManager5startERKSsb[_ZN5mongo14LoggingManager5startERKSsb]+0xb8): undefined reference toboost::filesystem3::detail::status(boost::filesystem3::path const&, boost::system::error_code* )'
collect2:错误:ld 返回 1 个退出状态
make[2]: * [bin/cml_cloud] 错误 1
make[1]: * [bin/CMakeFiles/cml_cloud.dir/all] 错误 2
make: * [all] 错误 2
我以前从未遇到过这种问题。 如何解决?
【问题讨论】:
标签: mongodb