Boost logo

Boost Users :

From: Scott Meyers (usenet_at_[hidden])
Date: 2007-05-30 13:15:16


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 list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net