[英]linking boost in 64-bit program VS2015
我正在将一个大型的Boost密集型程序升级到VS2015,并提升1.61。 该程序是64位程序-x64
Boost似乎在64位模式下寻找错误的库(或更可能是我做了一些愚蠢的事情)。 我相信我已经为VS2015平台构建了正确的Boost库。
我从头开始尝试在WIN32模式下制作一个微小的boost函数,该函数需要静态链接。 效果很好......
#include <boost/regex.hpp>
#include <iostream>
#include <string>
void test()
{
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;
}
}
但是,当我想在x64 boost中进行编译时会抱怨。 是的,我已经为两个平台正确设置了#include和链接路径。 库不在那里。
1> LINK:致命错误LNK1104:无法打开文件'libboost_regex-vc140-mt-gd-1_61.lib'
libboost_regex-vc140-mt-1_61.lib
您需要构建编译器要求的正确库集。 您应该查阅库命名表以获取在构建时要使用的构建参数(即属性)。 在您的情况下,它正在寻找标记为“ lib--mt-gd-1_61.lib”的库。 哪个读图说您需要构建:
link=static threading=multi runtime-debugging=on variant=debug
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.