After following this thread lower down, I think that you're confusing -l (lower case l) and -L (capital L). Lower case -l specifies the individual library you are linking to (ex boost_filesystem). Capital -L specifies a directory or directories (you can use -L and -l as many times as you have to) where the linker should look for the libraries specified by the lower case -l's On Wed, 2007-05-30 at 10:15 -0700, Scott Meyers wrote:
Vladimir Prus wrote:
What is the exact command line you've used, and what is the exact error you've got?
D:\Temp>g++ -Wall -O3 -ID:\C++\Boost\Current -o boostbuildtest.exe boostbuildtest.cpp -lboost_filesystem -lboost_regex d:\apps\msys\1.0\mingw\bin\..\lib\gcc\mingw32\4.1.1\..\..\..\..\mingw32\bin\ld.exe: cannot find -lboost_filesystem collect2: ld returned 1 exit status
Reversing the order of the libraries to link yields this:
D:\Temp>g++ -Wall -O3 -ID:\C++\Boost\Current -o boostbuildtest.exe boostbuildtest.cpp -lboost_regex -lboost_filesystem d:\apps\msys\1.0\mingw\bin\..\lib\gcc\mingw32\4.1.1\..\..\..\..\mingw32\bin\ld.exe: cannot find -lboost_regex collect2: ld returned 1 exit status
This suggests that whichever library is listed first is the one leading to the linker quitting.
Specifying full paths doesn't help:
D:\Temp>g++ -Wall -O3 -ID:\C++\Boost\Current -o boostbuildtest.exe boostbuildtest.cpp -lc:\boost_current\lib\boost_regex -lc:\boost_ current\lib\boost_filesystem d:\apps\msys\1.0\mingw\bin\..\lib\gcc\mingw32\4.1.1\..\..\..\..\mingw32\bin\ld.exe: cannot find -lc:\boost_current\lib\boost_regex collect2: ld returned 1 exit status
But the libraries are there:
D:\Temp>ls c:\boost_current\lib | grep filesystem | grep mgw boost_filesystem-mgw41-1_34.a boost_filesystem-mgw41-d-1_34.a boost_filesystem-mgw41-mt-1_34.a boost_filesystem-mgw41-mt-d-1_34.a libboost_filesystem-mgw41-1_34.a libboost_filesystem-mgw41-d-1_34.a libboost_filesystem-mgw41-mt-1_34.a libboost_filesystem-mgw41-mt-d-1_34.a libboost_filesystem-mgw41-mt-s-1_34.a libboost_filesystem-mgw41-mt-sd-1_34.a libboost_filesystem-mgw41-s-1_34.a libboost_filesystem-mgw41-sd-1_34.a
D:\Temp>ls c:\boost_current\lib | grep regex | grep mgw libboost_regex-mgw41-1_34.a libboost_regex-mgw41-d-1_34.a libboost_regex-mgw41-mt-1_34.a libboost_regex-mgw41-mt-d-1_34.a libboost_regex-mgw41-mt-s-1_34.a libboost_regex-mgw41-mt-sd-1_34.a libboost_regex-mgw41-s-1_34.a libboost_regex-mgw41-sd-1_34.a
Suggestions?
Thanks,
Scott
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users