gpt4 book ai didi

c++ - 编译器似乎找不到 boost/shared_ptr.hpp

转载 作者:行者123 更新时间:2023-11-28 05:25:45 24 4
gpt4 key购买 nike

我使用的是装有 OS 10.11.6 的 Mac

我正在尝试安装 OpenGV在我的 Mac 上。这是构建 OpenSfM 所需的依赖项的一部分图书馆。所以,我所做的是:

brew install homebrew/science/ceres-solver
brew install boost-python
brew install eigen
git clone https://github.com/paulinus/opengv.git
cd opengv
mkdir build
cd build
cmake .. -DBUILD_TESTS=OFF -DBUILD_PYTHON=ON
make install

但是我得到了这个错误:

In file included from /Users/hilman_dayo/opengv/src/relative_pose/modules/main.cpp:47:
/Users/hilman_dayo/opengv/include/opengv/math/Sturm.hpp:43:10: fatal error: 'boost/shared_ptr.hpp' file not found
#include <boost/shared_ptr.hpp>
^
1 error generated.
make[2]: *** [CMakeFiles/opengv.dir/src/relative_pose/modules/main.o] Error 1
make[1]: *** [CMakeFiles/opengv.dir/all] Error 2
make: *** [all] Error 2

我该如何解决这个问题?已经检查过,文件位于 /usr/local/include/boost/shared_ptr.hpp

如果需要,这是 cmake 期间的输出:

-- The C compiler identification is AppleClang 7.3.0.7030031
-- The CXX compiler identification is AppleClang 7.3.0.7030031
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Checking for C++11 compiler
-- Checking for C++11 compiler - available
-- Performing Test SUPPORTS_STD_CXX11
-- Performing Test SUPPORTS_STD_CXX11 - Success
-- Performing Test SUPPORTS_STD_CXX01
-- Performing Test SUPPORTS_STD_CXX01 - Success
-- Found Eigen: /usr/local/include/eigen3 (Required is at least version "2.91.0")
CMake Warning at /usr/local/Cellar/cmake/3.6.3/share/cmake/Modules/FindBoost.cmake:743 (message):
Imported targets not available for Boost version 106200
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.6.3/share/cmake/Modules/FindBoost.cmake:842 (_Boost_COMPONENT_DEPENDENCIES)
/usr/local/Cellar/cmake/3.6.3/share/cmake/Modules/FindBoost.cmake:1395 (_Boost_MISSING_DEPENDENCIES)
python/CMakeLists.txt:2 (find_package)


-- Boost version: 1.62.0
-- Found the following Boost libraries:
-- python
-- Found PythonLibs: /usr/lib/libpython2.7.dylib (found version "2.7.10")
-- Found PythonInterp: /Users/hilman_dayo/.virtualenvs/cv/bin/python2.7 (found version "2.7.12")
-- Found NumPy: version "1.11.1" /Users/hilman_dayo/.virtualenvs/cv/lib/python2.7/site-packages/numpy/core/include
-- Configuring done
CMake Warning (dev):
Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run "cmake
--help-policy CMP0042" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.

MACOSX_RPATH is not specified for the following targets:

pyopengv

This warning is for project developers. Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /Users/hilman_dayo/opengv/build

最佳答案

好的。 @usr1234567 的评论给我一个找到答案的提示。快速搜索后,我需要做的就是在命令行上执行:

xcode-select --install

关于c++ - 编译器似乎找不到 boost/shared_ptr.hpp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40570364/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com