ブースト: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
* .aファイルの正確な名前を入力すると、結果は次のようになります。cannot find -llibboost_regex-mgw47-mt-1_52.a
-ld:\boost\stage\lib\libboost_regex-mgw47-mt-1_52.a
動作しないパス全体ですら。後に置いたものは何でも-l
同じ効果があります。