此代码编译正常:
#include <boost\regex.hpp>
int main() {
boost::regex reg("[a-z]+");
}
但是在链接的地方有错误消息:
d:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: final link failed: Invalid operation
collect2.exe: error: ld returned 1 exit status
我必须在命令行中输入什么选项?我目前的开关是:
-I "d:\mingw\include" -I "d:\boost" -Os -s -o "test.exe" "test.cpp" -std=c++11 -ftree-vectorize -static