问题
Not sure why i get that, I downloaded libs from here and while I have a lib called 'libboost_regex-vc90-mt-gd-1_39.lib I don't have one which is called 'libboost_regex-vc100-mt-gd-1_39.lib', renaming the one with vc90 to vc100 works but I'm not sure if this is the ideal solution?
#include "stdafx.h"
#include <regex>
#include <boost/array.hpp>
#include <boost/regex.hpp>
#define BOOST_ALL_NO_LIB
int _tmain(int argc, _TCHAR* argv[])
{
boost::array<int, 10> a;
boost::smatch s;
getchar();
return 0;
}
回答1:
You are probably using Visual Studio 2010 (this is where vc100 comes from), but the downloaded lib was built with 2008 (vc9)
Visual Studio 2010 comes with TR1, include <regex>
and enjoy.
来源:https://stackoverflow.com/questions/1738089/when-trying-to-include-include-boost-regex-hpp-i-get-1link-fatal-error