【发布时间】:2014-08-02 02:59:51
【问题描述】:
我尝试了以下所有方法:
- 配置环境变量
- 重新构建
- 从源重新安装 BOOST
sudo apt-get install libboost-all-dev
但仍然出现以下错误:
CMake Error at /usr/share/cmake-2.8/Modules/FindBoost.cmake:1131 (message):
Unable to find the requested Boost libraries.
Unable to find the Boost header files. Please set BOOST_ROOT to the root
directory containing Boost or BOOST_INCLUDEDIR to the directory containing
Boost's headers.
Call Stack (most recent call first):
CMakeLists.txt:147 (find_package)
CMake Error at /usr/share/cmake-2.8/Modules/FindBoost.cmake:1131 (message):
Unable to find the requested Boost libraries.
Unable to find the Boost header files. Please set BOOST_ROOT to the root
directory containing Boost or BOOST_INCLUDEDIR to the directory containing
Boost's headers.
boost源代码目录:/usr/local/src/boost_1_45_0
Boost 库路径:/usr/local/lib
Boost头文件:/usr/local/include/boost
这里是bashrc file:
BOOST_ROOT="/usr/local/src/boost_1_45_0"
Boost_LIBRARY_DIRS="/usr/local/lib"
BOOST_INCLUDEDIR="/usr/local/src/boost_1_45_0"
如何解决这些错误?我错过了什么吗?
编辑:
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDTOOLCHAIN -DBOOST_ROOT=/usr/local/src/boost_1_45_0 -DBOOST_INCLUDEDIR=/usr/local/include/boost -DBOOST_LIBRARYDIR=/usr/local/lib -DPYTHON_LIBRARIES=/usr/local/lib/python2.7 -DPYTHON_INCLUDE_DIRS=/usr/include/python2.7 -DCMA-DRDK_BUILD_PYTHON_WRAPPERS=
【问题讨论】:
-
如果你做
cmake . -DBoost_DEBUG=ON,你能显示CMake的输出吗? -
看起来它没有拾取环境变量。请参阅输出的第 8-10 行。您可以尝试将这些作为 CMake 变量传递。也许即使只是 BOOST_ROOT 就足够了:
cmake . -DBOOST_ROOT=/usr/local -
很高兴知道 Boost 问题是什么。至于交叉编译时的Python,我真的帮不上什么忙。看起来您可以通过在第 114 行附近编辑 CMakeLIsts.txt 文件来禁用 CMake 尝试查找 Python,但如果他们已经要求它,可能它正在无条件地在其他地方使用,然后您就会失败观点。就像我说的,可能是时候提出一个新问题了:-)
-
@AmitPal 请自己添加答案,而不是在问题中编辑答案,这样人们就可以看到问题已得到解答。
-
@AmitPal - EDIT 下的最后一行是否解决了问题?如果是,那么请回答您自己的问题,以便人们回答问题,正如 Andreas Haferburg 在上面的评论中所说。