【发布时间】:2016-09-24 09:11:44
【问题描述】:
我正在将一个大型 boost 密集型程序升级到 VS2015 和 boost 1.61。该程序是64位程序-x64
Boost 似乎在 64 位模式下寻找错误的库(或者更有可能我做了一些愚蠢的事情)。我相信我已经为 VS2015 平台构建了正确的 boost 库。
我尝试在 WIN32 模式下从头开始制作一个微小的增强功能,这需要静态链接。这工作正常......
#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>链接:致命错误 LNK1104:无法打开文件“libboost_regex-vc140-mt-gd-1_61.lib”
libboost_regex-vc140-mt-1_61.lib
【问题讨论】:
-
名字的
-gd部分表示调试,尝试在release模式下编译你的程序或者在debug模式下编译boost库
标签: c++ boost visual-studio-2015