我MinGW的編譯器:http://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/4.7.2/32-bit/threads-posix/sjlj/x32-4.7.2-release-posix-sjlj-rev6.7z不能提振正則表達式鏈接到MinGW的
升壓:http://sourceforge.net/projects/boost/files/boost/1.52.0/boost_1_52_0.7z
(無論在d:驅動器)
代碼:
#include <boost\regex.hpp>
int main() {
boost::regex reg("[a-z]+");
}
命令行:
SET PATH=%PATH%;D:\mingw\bin;D:\mingw\include
g++ -I "d:\mingw\include" -I "d:\boost" -Os -s -o test.exe test.cpp -std=c++11 -static -L "D:\boost\stage\lib" -lboost_regex
在d:\boost\stage\lib
目錄中有libboost_regex-mgw47-mt-1_52.a
。
,並且處理返回:
d:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lboost_regex
collect2.exe: error: ld returned 1 exit status
如果我把的確切名稱*某文件的結果是cannot find -llibboost_regex-mgw47-mt-1_52.a
甚至整個路徑是-ld:\boost\stage\lib\libboost_regex-mgw47-mt-1_52.a
不起作用。無論我在-l
之後放置的效果如何,