尝试使用生成文件编译程序时"fatal error: boost/regex.hpp: No such file or directory" C++
"fatal error: boost/regex.hpp: No such file or directory" when trying to compile C++ program using a makefile
我正在尝试编译一个名为"物种"的开源软件在文本中识别分类学提及。我在MacOS 。
我下载了源代码(可以在此处找到(,移至目录中,并使用命令make
进行编译。这是返回的错误:
g++ -fpic -pthread -Wall -O3 -o organisms organisms.cxx -lm -lboost_regex
In file included from batch_tagger.h:5:0,
from organisms.cxx:3:
tagger.h:7:27: fatal error: boost/regex.hpp: No such file or directory
compilation terminated.
make: *** [organisms] Error 1
我使用brew install boost
安装了 C Boost Library ,并再次尝试了上述步骤(它不起作用(。
我尝试将Boost目录列入包含源代码的目录(它不起作用(。
有任何建议/帮助?
您需要告诉编译器在哪里可以找到Boost标头。
您需要使用Include路径选项来指定可以在何处找到可以找到升压标头的位置,请使用-I/path/to/boost/include
。
然后使用来自代码的#include <boost/regex.hpp>
包含文件。
相关文章:
- 使用 boost::regex 从目录中获取带有一些正则表达式的文件名称时出现意外输出
- 在VC2015U3上,std::regex比boost::regex慢得多
- 使用 boost::regex (c++) 比较两个正则表达式
- Build Boost Regex for Windows VS2013
- std::string references、std::regex和boost::filesystem的基本概念
- boost::regex 和std::regex之间的不一致?
- 尝试使用生成文件编译程序时"fatal error: boost/regex.hpp: No such file or directory" C++
- 使用Boost或Regex拆分这条线
- 带有Boost Regex库的未解决的外部对象
- Byte Regex与C 的Boost匹配
- boost::regex链接问题在Xcode 4.5.2中
- 如何检查使用哪个匹配组进行匹配(boost-regex)
- boost::regex和std::regex之间的不一致
- Boost.Regex parsing
- BOOST.REGEX定界器解析
- 以下等级表达式不适合Boost Regex
- C++, TR1, Regex and Boost
- 在Windows C 代码:: Blocks上的Boost Regex
- Boost Regex用于格式化MAC地址字符串
- Regex boost library comparing