Pie*_*tro 10 boost version cmake environment-variables
我安装了多个版本的Boost(Windows 7/MinGW).我需要使用一个特定的(1.53.0).
我在CMakeFiles.txt文件中定义了BOOST_ROOT: SET(BOOST_ROOT C:/boost_1_53_0/)但是我一直收到这个错误:
> cmake .
BOOST_ROOT=C:/boost_1_53_0/
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:1191 (message):
Unable to find the requested Boost libraries.
Boost version: 1.48.0
Boost include path: C:/Boost/include/boost-1_48
Detected version of Boost is too old. Requested version was 1.53 (or
newer).
The following Boost libraries could not be found:
boost_filesystem
No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the
directory containing Boost libraries or BOOST_ROOT to the location of
Boost.
Run Code Online (Sandbox Code Playgroud)
我还将BOOST_ROOT定义为环境变量,但结果相同.
为什么cmake还在寻找旧版本?
小智 10
我也一直在努力解决同样的问题.如果这是我遇到的同样问题,那么问题是你没有在没有任何缓存的情况下完全运行CMake配置.一旦运行一次并找到默认安装(C:\ Boost或/ usr/include),无论BOOST_ROOT的值如何,它都将继续找到该安装.因此,请确保完全删除任何生成的构建文件.然后将BOOST_ROOT设置为您想要的单独安装,它应该可以正常工作.
jaor在前面提到的问题上也提到了这一点:我怎样才能让cmake找到我的替代升压装置?
如果您正在为Visual Studio使用预编译版本的Boost库,那么它们具有特定的MSVC版本和位数.我需要将CMake指向该特定位置 - 在我的例子中,将BOOST_ROOT设置为C:/ local/boost_1_59_0和BOOST_LIBRARYDIR为C:/local/boost_1_59_0/lib64-msvc-11.0帮助.
| 归档时间: |
|
| 查看次数: |
40865 次 |
| 最近记录: |