Now, that the tools are almost complete created (Linux to Win32/64 Crosscompile toolchain) I will develop some nice apps. I choose wxWidgets for the GUI jobs. First, there is a test Project. The test project can be found on github.

Simply checkout the branch with git clone

If you don't which to build it yourself, you can download the toolchain as follow

wget -c
wget -c
wget -c
wget -c

tar -xf gcc-5.1.0-i686-mingw32.tar.gz
tar -xf gcc-5.1.0-x86_64-mingw32.tar.gz
tar -xf wxWidgets-3.0.2-i686-pc-mingw32.tar.gz
tar -xf wxWidgets-3.0.2-x86_64_pc_linux.tar.gz

The next steps will create the wxWidgets library for the Win32/64 and linux64 machines. That means that will create the .a and the dll libs for building and for dynamicaly linking the created app.

1. Setup required environment settings

I will compile the neccessary libs and executables for the x86_64 and i686 machines respectivelly but first download wxWidgets-3.0.2.tar.bz2

export TARGET=i686-pc-mingw32 or x86_64-pc-mingw32

export PREFIX=/home/user/your/path_for_wxWidgets_build

export SYSROOT=/home/user/your/path_for_$TARGET_build

export PATH=/home/user/your/path_for_build/bin:$PATH

So this is my configuration for the first i686 build

export TARGET=i686-pc-mingw32

export PREFIX=/home/$USER/progs/wxWidgets-i686-pc-mingw32-output

export SYSROOT=/home/$USER/progs/gcc-5.1.0-i686-mingw32

export PATH=$SYSROOT/bin:$PATH

 2. Configure and build wxWidgets

  1. cd /home/$USER/your_path
  2. tar -xf wxWidgets-3.0.2.tar.bz2
  3. mkdir build-wxWidgets
  4. cd wxWidgets
  5. ../wxWidgets-3.0.2/configure --prefix=$PREFIX --with-systemroot=$SYSROOT --host=$TARGET --with-msw --enable-all-features
  6. e.g. for Linux x86_64: ../configure --prefix=$PREFIX --enable-debug --with-x --enable-unicode --enable-monolithic --enable-shared
  7. make -j4
  8. make install

 3. Test project

I tooked the HelloWorkd sources from the wxWidget page. Original for review. You may need to put the libraries where the executable are or adjust the LD_LIBRARY_PATH for the library path.

Now lets have a look at the structure of the test Project.

 Project folder structure

1. Compiling the Hello World src for Linux x86_64

`./wx-config-linux --prefix=./tools/wxwidgets-3.0.2-x86_64_linux --cxx --cxxflags --libs` src/wxHelloWorld.cpp -o output/linux/wxHalloWorld

Linux test executable

2. Compiling the Hello World src for Windows x86

For the Windows build the gcc build tools/gcc-5.1.0-i686-mingw32 is uses for building the executible. Alternativelly the x86_64 source can be build with tools/gcc-5.1.0-x86_64-mingw32 respectivally.

`./wx-config-mingw32 --prefix=./tools/wxWidgets-i686-pc-mingw32 --cxx --cxxflags --libs --host=i686-pc-mingw32` src/wxHelloWorld.cpp -o output/win32/wxHelloWorld.exe -Wl,"-L./tools/wxWidgets-i686-pc-mingw32/lib -lwx_mswu-3.0-i686-pc-mingw32.dll" -lwx_mswu-3.0-i686-pc-mingw32.dll

win32 Testing



Note: I am not responsible for any consequences you may experience following the technical descriptions on, regardless of what, who, why and how. I am not responsible, no way.