Boost logo

Boost-Build :

From: John Maddock (john_at_[hidden])
Date: 2007-12-10 06:59:51


Petrus B. van Bork wrote:
> Here is my console output:
>
>
> **** Build of configuration Debug for project BoostTest ****
>
> mingw32-make all
> 'Building target: BoostTest.exe'
> 'Invoking: MinGW C++ Linker'
> g++
> -L"e:\BoostCPlusLibraries\bin\boost_1_34_1\bin.v2\libs\filesystem\build\gcc-mingw-3.4.5\debug\-lboost_filesystem-mgw34-d-1_34_1"
> -Wl,--out-implib=boost -o"BoostTest.exe" ./main.o
> -l"e:\BoostCPlusLibraries\boost_1_34_1\bin.v2\libs\filesystem\build\gcc-mingw-3.4.5\debug\boost_filesystem-mgw34-d-1_34_1.a"
> e:\mingw\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe:
> cannot find
> -le:\BoostCPlusLibraries\boost_1_34_1\bin.v2\libs\filesystem\build\gcc-mingw-3.4.5\debug\boost_filesystem-mgw34-d-1_34_1.a
> collect2: ld returned 1 exit status
> mingw32-make: *** [BoostTest.exe] Error 1

OK lets break down your Mingw command line:

-L"e:\BoostCPlusLibraries\bin\boost_1_34_1\bin.v2\libs\filesystem\build\gcc-mingw-3.4.5\debug\

There are a couple of things here: this directory is the temporary directory
where libraries are built, it's not where they are *installed*. I can't
remember off hand but the correctly mangled library names may not be present
there. Did you do a "bjam install" to build things? If so then the
libraries should be in c:\Boost\lib. Alternatively a "bjam stage" would
have put them in e:\BoostCPlusLibraries\stage\lib.

Also gcc Mingw doesn't like paths that end in a "\" unfortunately :-(

Also there should be a space after this and before the following command
line argument.

-lboost_filesystem-mgw34-d-1_34_1

Must appear *after* the source files that use it. The gcc linker is
particulary brain dead in this regard I'm afraid :-(

And finally: the default bjam build behaviour on Windows is to build static
libraries with a .lib extension, which unfortunately Minwg won't find if you
use a -lboost_foo command line argument (looks like a bug) :-(

You can either rename these to .a manually or simply add the .lib file
directly to your project: if you want to link to the .dll's then this is
what you will have to do anyway as the Mingw linker can't find dll's, only
.a static libraries :-(

HTH, and I hope we can get your frustration levels back down to normal
levels :-)

Unfortunately most of these problems occur because Mingw and Cygwin behave
neither completely like a Unix compiler, nor like a Windows one, but some
curious mixture of them both.

Regards, John Maddock.


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk