C++程序找不到boost

问题描述 投票:0回答:1

我正在尝试编译 MultiNEAT 项目(https://github.com/peter-ch/MultiNEAT)。我已经安装了boost和boost-python,它位于/usr/local/Cellar/boost。我还编辑了 ~/.bash_profile 将 /usr/local/Cellar/boost/1.60.0_1/include 添加到 PATH 中。但是,当我尝试通过

编译并安装 MultiNEAT 时
sudo python setup.py install

我收到错误:

running install
running build
running build_py
running build_ext
building '_MultiNEAT' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/Genome.cpp -o build/temp.macosx-10.11-intel-2.7/src/Genome.o -march=native -DUSE_BOOST_PYTHON -DUSE_BOOST_RANDOM -std=gnu++11 -g -Wall
src/Genome.cpp:37:10: fatal error: 'boost/unordered_map.hpp' file not found
#include <boost/unordered_map.hpp>
     ^
1 error generated.
error: command 'cc' failed with exit status 1

怎样才能让程序找到boost库并成功编译MultiNEAT?我的系统是 OS X Yosemite。

c++ boost evolutionary-algorithm cc
1个回答
1
投票

您必须更改编译定义以包含 boost 头文件。您可能需要将 boost 库(及其目录)添加到链接设置中。如果您发布了构建应用程序的方式,我可以说更多。

© www.soinside.com 2019 - 2024. All rights reserved.