Problems compiling with MinGW? Perhaps this will help

After much time and frustration I’ve learned that the MinGW instructions for compiling Cataclysm-DDA are lacking a few bits of information. Follow these simple instructions:

  1. Download the latest Cataclysm-DDA source code.

  2. Extract the compressed file to the folder of your choice. Example: C:\github\Cataclysm-DDA

  3. Download the latest MinGW installer.

  4. Run MinGW installer and check the box for C++ Compiler and MinGW Developer ToolKit options. (NOTE: If we fail to install these options, then compiling will fail.)

  5. Start the MinGW Shell. Start \ Programs \ MinGW \ MinGW Shell

  6. A new window will open. At the prompt, change to the folder containing the source code we extracted in Step 2:

[tt]cd C:\github\Cataclysm-DDA[/tt]

  1. Once inside the correct directory run the following commands:

[tt]make clean
make -f Makefile.Windows[/tt]

NOTE: The compile will take several minutes to complete.

  1. Profit!

We can open cataclysm.exe directly from this folder, or we could copy the data folder and cataclysm.exe to another folder of our choice. Example: C:\games\Cataclysm-DDA

You can also replace this with code blocks, open the catalclysmWin project file, and click build-> compile

Thank you, for pointing that out. You could try Visual Studio Express, or use the clunky Cygwin, or just install Linux. This thread is for those that want to use MinGW. For what it’s worth, I tried Code::Blocks several times and received some 36 errors and the compile failed. MinGW has compiled flawlessly. YMMV.

Btw if you’re using the windows makefile, you should comment “OTHERS = -O3” out of the makefile. Level 3 optimizations make compiling take a lot longer.

^ this.

there’s a codeblocks installer that comes with MinGW as standard. Works like a charm for me.

Great tip, ejseto! Thanks for mentioning it.

^ this.

there’s a codeblocks installer that comes with MinGW as standard. Works like a charm for me.[/quote]

GUI vs command line is like Windows vs Linux; Everyone has their own opinion. Besides all that, some people might prefer not to install a 240MB IDE, that they may never use, simply to compile a program with the exact same compiler. C’est la vie. Freedom of choice is a beautiful thing.