Boost logo

Boost-Build :

From: Daniel Albuschat (d.albuschat_at_[hidden])
Date: 2007-01-24 02:24:23


Hi there,

I've tried to build bcp on win32 with the mingw gcc port, but I failed.
Here are the steps I've done:

- Install the win32 Platform-SDK
- Install mingw using the mingw-installer 5.0.2 [1]
- Download boost-jam 3.1.13
- Build boost-jam with the build.bat script.
- Copy the bjam executable to \Windows\sytem32 (or somewher in PATH)
- Download boost sourcecode version 1.33.1
- Build boost with the command "bjam -sTOOLS=mingw"
  (iirc 23 targets failed to build, but >1000 succeeded)
- Change to the tools\bcp directory
  Try to build with bjam -sTOOLS=mingw

The build fails with undefined references to
   bjam_implementation::add_file() and
   bjam_implementation::add_path()

Here's the failing action:

gcc-Link-action ..\..\bin\boost\tools\bcp\bcp.exe\mingw\release\bcp.exe
..\..\bin\boost\tools\bcp\bcp.exe\mingw\release\bcp_imp.obj:bcp_imp.cpp:(.text+0
x2431): undefined reference to
`bcp_implementation::add_file_dependencies(boost:
:filesystem::path const&, bool)'
..\..\bin\boost\tools\bcp\bcp.exe\mingw\release\bcp_imp.obj:bcp_imp.cpp:(.text+0
x3534): undefined reference to
`bcp_implementation::add_path(boost::filesystem::
path const&)'
..\..\bin\boost\tools\bcp\bcp.exe\mingw\release\bcp_imp.obj:bcp_imp.cpp:(.text+0
x36c6): undefined reference to
`bcp_implementation::add_path(boost::filesystem::
path const&)'
..\..\bin\boost\tools\bcp\bcp.exe\mingw\release\bcp_imp.obj:bcp_imp.cpp:(.text+0
x3855): undefined reference to
`bcp_implementation::add_path(boost::filesystem::
path const&)'
..\..\bin\boost\tools\bcp\bcp.exe\mingw\release\bcp_imp.obj:bcp_imp.cpp:(.text+0
x39e4): undefined reference to
`bcp_implementation::add_path(boost::filesystem::
path const&)'
..\..\bin\boost\tools\bcp\bcp.exe\mingw\release\bcp_imp.obj:bcp_imp.cpp:(.text+0
x3aa3): undefined reference to
`bcp_implementation::add_path(boost::filesystem::
path const&)'
collect2: ld returned 1 exit status

Here's the output for
C:\Source\boost\bin\boost\tools\bcp\bcp.exe\mingw\release>nm
add_path.obj | grep add_path | c++filt
(line cut because of e-mail widths limitation)

File STDIN:
0000c850 t global destructors keyed to
_ZN18bcp_implementation8add_pathERKN5boost10filesystem4pathE
0000c840 t global constructors keyed to
_ZN18bcp_implementation8add_pathERKN5boost10filesystem4pathE
000054c0 T bcp_implementation::add_path(boost::filesystem::path const&)

This means that the symbol actually *is* there, but ld doesn't find it.
It's a miracle to me.

I was curious why that happened, because those kind of linker
errors usually mean that the source-code is broken.
So I've hacked together a small Makefile which simply
compiles all (but the platform-specific) .cpp files and
links them together to bcp.exe.
This succeeded. I guess the bcp.exe alone is not enough, because
I was unable to use it in any way (e.g. bcp threads
../mini-boost/threads did not succeed, the program exits with
return code 3, without giving a message).

But back to the bjam problem: Although the sourcecode seems correct,
the object file does not contain the functions that it ought to contain.
This may be a mingw32-bug (which I somewhat doubt) or a bug in the
boost build system, which is IMHO more likely.

I did not find a way to have bjam show what commands it actually
executes. The commands are hidden behind a (to me) useless
"gcc-Link-action" or similar "name".
Is there a way to let bjam simply output the exact commands it
executes? That way I could work my way to nail the error down.
Currently, I have no clue what could be causing the missing symbols.

Regards,
   Daniel Albuschat

[1]: Uses g++ 3.4.2, download from:
     http://prdownloads.sf.net/mingw/MinGW-5.0.2.exe?download


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