

The following is how I did this on Ubuntu 'Dapper Drake' Linux: As such, I decided it was time to sign up for the c::b forums and post a howto in case anyone else was interested in knowing what I did. Today I managed to finish figuring out how to set up the build options for cross compiling, debugging and running windows executables for projects built with Code::Blocks using linux. The following has been copied from a forum article originally posted by visualphoenix:

Remember that you will have to rebuild the whole project. Now you can start a new project or open an existing project, and if you want to make a cross compilation for Windows platforms, just go to Project->Build Options and select your cross compiler. Just select the directory where you have copied all the compilers binaries ( /usr/i586-mingw32msvc/ ) and setup the executables as shown in the picture below. The last step is to tell Code::Blocks where and what your cross compiler binaries are. The pictures below show how it should look like. For every entry you have to put: /usr/i586-mingw32msvc. You will need to setup the directories for Compiler, Linker, and Resource Compiler. Now you will have to change some directories for the new cross compiler. Go to Settings->Compiler and Debugger Settings and create a copy of the current selected compiler. To let Code::Blocks know about your cross compiler you have to create a new compiler profile. Setup Code::Blocks to use the Cross Compiler Install the mingw package from the Universe Repository, using synaptics or with the following command: Depending on your distribution, the installation of the needed packages can differ.

This will describe how to setup your Linux box to compile your code for the Windows platform using 1.2 Setup Code::Blocks to use the Cross Compiler.The solution for this would be to deactivate the anti virus, or add the compiler directory to the ignore list. You can also search for "mingw32-gcc.exe" and point the "Compiler installation directory" to the corresponding bin folderĪ other cause can be that your anti virus program blocks the compiler "mingw32-gcc.exe" because it thinks that it is a virus. You should check if the path under "Settings->Compiler->Toolchain executables->Compiler installation directory" points to this location I can't check this at the moment, but the default installation path should be something like c:\program files (x86)\Codeblocks\MinGW If so, the compiler should be installed in the codeblocks installation folder. This error can have multiple causes, but i think the main cause is that codeblocks can't find or launch the compiler. (To devs: If this error arises there should be a more detailed error messages, like compiler in path not found, with detailed search paths or so.)
