cross compiling

I was originally gonna post this in response to seth’s question at, but then thought it would be hijacking the thread so posting it separately.

Does anyone have experience with cross compiling? Building an exe for windows straight from my xcode would be ace :stuck_out_tongue: gcc is supposed to support it, and I’m sure it can be dodgy as hell. But it could still be quite handy if the project files were setup with the right options if possible…

it can be done, but don’t know exactly how :), i googled about some time ago and seemed complex for what i remember.

also some time ago was taking a look at cmake and it seems it supports cross compiling, so it should be easier than just trying to setup gcc

what do you mean by cross-compiling? just posix systems or also for windows?

i am sure you can tell gcc to create a win32-ABI-compatible exe, but you are lacking the libs. why not just setup some makefiles (maybe via cmake) or project files (msvc, codeblocks, …) and copy the solution + compile on demand? i am sure it would be very convenient but i am also sure you can drink a coffee and smoke a cigarette while copying the source files and hit compile?! :wink:

hmmm, look what i found in my delicious bookmarks - interesting……-m-macos-x/

if you go the other way. other useful tools:…-onfig.html

what do you mean by cross-compiling? just posix systems or also for windows?

yea, compiling for linux and windows, straight from my mac. I"d obviously need the libs (maybe even precompiled oF libs for all platforms). I could test the binaries through bootcamp or parallels, but I just don’t want to use codeblocks and actually develop on other platforms (i know debugging won’t work with this method, but I’m neglecting those problems for now).

Yeah, sounds like this fits in some with my proposal for a cross-platform OF download.

Still, sounds like a big mess if done from source. On the other hand doing this in conjunction with precomiled oF libs sounds very feasible and awesome.

for linux:

sudo apt-get install mingw32-binutils mingw32 mingw32-runtime  

download codeblocks-additions for windows and copy lib contents to:


and include contents to:


in codeblocks, under settings > compiler & debugger

select gcc and press copy, then in toolchain-executables > program files substitute:

g++ with i586-mingw32msvc-g++
ar with i586-mingw32msvc-ar

in toolchain-executables > aditional paths add:


and voila, windows codeblocks projects just compile in linux, you will have some issues with some incorrect capitalisation, or \ instead of / but it works.

for mac:

configuring codeblocks should be more or less the same than under linux.

JFYI, fedora linux and mingw are your friends ……-s-compiler