[英]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.