I have downloaded "boost" (1.40.0) source code from their homepage "www.boost.org". I have Linux (Ubuntu 9.04 Jaunty) installed and trying to compile the boost libraries to the "WINDOWS" version (e.g. ".dll", NOT ".so") from my "LINUX" machine.
And now an important question:
IS IT POSSIBLE TO COMPILE TO THE "WINDOWS" BOOST LIBRARIES FROM "LINUX" (if someone say "yes" I will trust him only if he has already done it before of will write here a solution which will work for me. Sorry for that pessimism but I am trying to do this about for 3 days and nothing positive so far)?
So far I have compiled c++ programs this way. For compiling from Linux to Linux I have used "gcc" (or "g++") compiler. For compiling from Linux to Windows I have used "i586-mingw32msvc-gcc" (or "i568-mingw32msvc-g++") compiler (which is contained in "mingw32" package for "Ubuntu" for example).
So this strategy I have wanted to use also to compile boost libraries and I have tried this so far (after reading the "Getting started" article on the boost homepage):
--1. I have run "bootstrap.sh" from the "root" boost source code directory:
./bootstrap.sh
--2. Then I have changed one thing in the file "project-config.jam" (from "using gcc ;"):
using gcc : : i586-mingw32msvc-gcc ;
--3. And finally run "bjam" executable:
./bjam stage
But instead of creation of the "Windows" version of the boost libraries I got lots of error-messages.
Can anybody help me?
Thanks in advance.
Petike
The official documentation has a section on cross compilation. Comparing that with what you are doing, there are two issues:
You specify i586-mingw32msvc-gcc and should specify i586-mingw32msvc-g++. The former is a C compiler, which is a bit tricky to use to compile C++ codebase ;-)
You need target-os=windows
Note that there's one known bug there -- when creating static libraries, they are not passed via ranlib, and mingw linker is specifically upset about this. You would have to run ranlib manually if you plan to use static libraries.
There is a very simple procedure to follow to cross build boost from linux to windows here :
https://web.archive.org/web/20110604002004/http://www.vle-project.org/wiki/Cross_compilation_Win32
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With