Question

I'm trying to install boost library (1.53) to use it in 64 bit application under Windows. However, I'm getting a series of errors while trying to setup it the same way I used to do with MinGW32 and older boost releases...

Now, I keep failing at the first step - executing ./bootstrap.sh. Following errors are returned:

mkdir bootstrap
gcc -o bootstrap/jam0 command.c compile.c constants.c debug.c function.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c object.c option.c output.c parse.c pathunix.c regexp.c rules.c scan.c search.c subst.c timestamp.c variable.c modules.c strings.c filesys.c builtins.c pwd.c class.c native.c md5.c w32_getreg.c modules/set.c modules/path.c modules/regex.c modules/property-set.c modules/sequence.c modules/order.c execunix.c fileunix.c
function.c: In function ÔÇścheck_alignmentÔÇÖ:
function.c:222:5: warning: cast from pointer to integer of different size
builtins.c:33:23: fatal error: sys/wait.h: No such file or directory
compilation terminated.
execunix.c:17:26: fatal error: sys/resource.h: No such file or directory
compilation terminated.
fileunix.c:98:17: fatal error: ar.h: No such file or directory
compilation terminated. 

When I run bootstrap.bat instead, Boost.Build build itself, however I'm getting strange errors later. At first, I tried to symlink the x86_64-w64-mingw32-gcc etc executables to gcc, however it ended up with numerous "Access denied" errors, so I just copy-pasted the x86_64-w64-mingw32-XX files into simple XX.exe ones. Now I can start the proper build, but end up with:

...failed gcc.archive bin.v2\libs\thread\build\gcc-mingw-4.5.3\debug\address-model-64\link-static\threading-multi\libboost_thread-mgw45-mt-d-1_53.a...
gcc.archive bin.v2\libs\thread\build\gcc-mingw-4.5.3\release\address-model-64\link-static\threading-multi\libboost_thread-mgw45-mt-1_53.a
System cannot find the path specified.
System cannot find the path specified.

I found out, that it's trying to use Win-like path slashes (/vs\), and probably failing because of it.

I don't want to use MSVC, since I'm trying to keep my code as much portable as possible, also it's kinda crucial for it to be 64bit.

Thanks in advance.

Was it helpful?

Solution

This looks like missing files in your Cygwin installation. Try running the setup again and make sure everything is installed for the gcc compiler (Cygwin, not MinGW64). I successfully ran bootstrap.sh, bjam was compiled fine with the default Cygwin gcc compiler. After that, I hit a few speed bumps, but everything compiled fine with MinGW64. I added the compiler executable in tools\build\v2\user-config.jam like this:

using gcc : 4.5.3 : x86_64-w64-mingw32-gcc.exe ;

I ended up with the following command lines:

./b2 --toolset=gcc target-os=windows --build-dir=/cygdrive/c/whatever/boost_build variant=debug,release link=static runtime-link=static architecture=x86 address-model=64 threadapi=win32 --layout=tagged --without-mpi --stagedir=lib/win64gcc -j4 stage

... and then I tried the same with link=shared runtime-link=shared, but I had a lot of compilation errors I have not yet figured out.

Some links that may help you:

EDIT: I ended up using MinGW64 TDM which is MUCH easier than Cygwin MinGW64 as it's not a cross-compiler. Simply install MinGW64 TDM, add MSYS, done! Boost compiles without any problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top