Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos CMake无法在使用brew的OS X上找到Boost_Macos_Boost_Cmake_Homebrew - Fatal编程技术网

Macos CMake无法在使用brew的OS X上找到Boost

Macos CMake无法在使用brew的OS X上找到Boost,macos,boost,cmake,homebrew,Macos,Boost,Cmake,Homebrew,我正在尝试使用CMake编译另一个库,它需要Boost 我已经在Yosemite OS X 10.10上安装了CMake和Boost,但CMake拒绝找到它。Boost位于/usr/local/ceral/Boost/1.55.0_2 我尝试了以下方法: 使用上述路径设置-DBoost\u DIR和-DBoost\u ROOT 使用上述路径设置-DBoost\u INCLUDE\u DIR和-DBoost\u INCLUDEDIR 在CMakeLists.txt文件中设置任何和所有这些选项 编

我正在尝试使用CMake编译另一个库,它需要Boost

我已经在Yosemite OS X 10.10上安装了CMake和Boost,但CMake拒绝找到它。Boost位于
/usr/local/ceral/Boost/1.55.0_2

我尝试了以下方法:

  • 使用上述路径设置
    -DBoost\u DIR
    -DBoost\u ROOT
  • 使用上述路径设置
    -DBoost\u INCLUDE\u DIR
    -DBoost\u INCLUDEDIR
  • 在CMakeLists.txt文件中设置任何和所有这些选项
  • 编译Boost我自己,并将上面的变量指向我自己的构建
  • 尝试相同问题的类似解决方案,以及。我发现在OS X上提到brew的唯一答案是,相同的解决方案不适用于我
为什么CMake公然无视我的指示(


编辑:

我发现了一个单独的自制包
boost python

brew install boost-python
给我

> mkdir build ; ( cd build ; cmake .. )
-- The C compiler identification is AppleClang 6.0.0.6000056
-- The CXX compiler identification is AppleClang 6.0.0.6000056
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found PythonInterp: /usr/local/bin/python (found version "2.7.9")
-- Found PythonLibs: /usr/lib/libpython2.7.dylib (found version "2.7.5")
-- Boost version: 1.56.0
-- Found the following Boost libraries:
--   python
-- Configuring done
-- Generating done

(我在链接上有问题,但那是另一回事)

我在用C++/Python/Boost/CMake编译某些东西时也遇到了问题(具体来说,我正在尝试构建)

我犯了这样的错误

Linking CXX shared library .../OpenSfM/opensfm/csfm.so
Undefined symbols for architecture x86_64:
  "boost::python::instance_holder::deallocate(_object*, void*)", referenced from:
Undefined symbols for architecture x86_64:
"boost::python::instance_holder::deallocate(_object*, void*)", referenced from:
...
受上述评论的启发,我试图找到这个神话般的“boostpython”,但它并不存在。相反,我最终使用自制软件用python重新安装了普通的boost

brew install boost --with-python

这就成功了。CMake现在可以找到boost和它需要的任何python boost东西,编译成功了。

在我的例子中,将CMake和boost升级到最新版本解决了这个问题

brew upgrade boost cmake

您是否可以使用
-DBoost\u DEBUG=ON
重新运行cmake并发布输出?@Fraser Done,问题中的链接您是否可以给出完整路径(包括文件名)请连接到您的Boost.System库?我也有同样的问题。您找到解决方案了吗?当我使用
brew安装Boost
安装Boost时,出现了这个问题。相反,使用
brew安装Boost python
时,它无法找到后面的Boost(对于Boost:python和python3)漂亮。谢谢!
警告:boost@1.59:此公式没有--with python选项,因此将被忽略!
brew安装boost--with python
似乎是一个临时解决方案,我们回到
brew安装boost python