Compile for Windows.

closed account (967L1hU5)
Hello, I am using Ubuntu 11.10 and Code::Blocks 10.05, and was wondering if/how I can compile my code to a .exe compatible for Windows from my Linux machine. Any help would be fantastic.
Install the package gcc-mingw32 and create a new compiler preset "MinGW" in Code::Blocks (Settings/Compiler and Debugger). For the toolchain executables, put a "i586-mingw32msvc-" in front of everything (i.e. i586-mingw32msvc-gcc, i586-mingw32msvc-g++ etc.).
That's it, you can now change your project settings to use MinGW as the compiler.
closed account (967L1hU5)
Thanks a ton! I wont be able to try it till tomorrow, I'll reply accordingly.
closed account (967L1hU5)
I wasn't able to add a new preset, but I it to compile. The compiled file wasn't a .exe thou, but when I Compiled&Run'd it via codeblocks, it was in Wine.
I wasn't able to add a new preset

Why, what's the problem?

The compiled file wasn't a .exe thou

You can manually specify the executable file name in the project settings (or rename it to .exe later).
Topic archived. No new replies allowed.