【发布时间】:2017-01-14 17:09:20
【问题描述】:
我使用 boost 1.61.0 和 cl 19 (visual studio 2015)。我使用命令行bootstrap和.\b2从获取开始文档构建了boost库。这使得 stage 目录带有一些 vc14 前缀库。
但是当我尝试编译启动正则表达式程序时
#include <boost/regex.hpp>
#include <iostream>
#include <string>
int main()
{
std::string line;
boost::regex pat( "^Subject: (Re: |Aw: )*(.*)" );
while (std::cin)
{
std::getline(std::cin, line);
boost::smatch matches;
if (boost::regex_match(line, matches, pat))
std::cout << matches[2] << std::endl;
}
}
使用此命令行编译器设置:
cl main.cpp -I %BOOST_ROOT% -L %BOOST_LIB_14% /EHsc
我收到此错误:
Link:: fatal error LNK1181: cannot open input file 'C:\local\boost_1_61_0\stage\lib.obj
我的尝试有什么问题?
编辑:我将命令行编译更改为:
cl main.cpp /I %BOOST_ROOT% /link /LIBPATH:%BOOST_LIB_14% /EHsc
现在,我收到此错误:
LINK: fatal error LNK1104: cannot open file 'libbosst_regex-vc140-mt-s-1_61.lib'
【问题讨论】:
标签: c++ boost boost-regex cl