I had an embarrassing amount of trouble compiling with Code::Blocks today, so I'm bringing up the helpful answers from this thread, and providing a tidy summary.
I managed to compile under Windows with the latest version of Code::Blocks (without the bundled MinGW), plus the latest TDM-GCC (http://tdm-gcc.tdragon.net/download, first bundle installer) and changing the project build setting where it says -lncurses for -lpdcurses (the only actual change to the files I got from Git). Which apparently works with or without the c++11 flag, as it is enabled in the debug but disabled in the release profile, and both compiled fine.
Trying to use MINGW or Visual Studio Express 2010, or the bundled-MinGW version of Code::Blocks just ended with failure and disappointment.
Shouldn't the Code::Blocks workspace file be updated? I still had to change -lncurses to -lpdcurses with the most recent from
https://github.com/Kamal-Sadek/Liberal-Crime-SquadOther than that, things went pretty okay once I followed the advice here:
It's under linker settings tab (don't select Debug or Release but the parent node "Liberal Crime Squad").
Also the TDM setup should work fine if you uncheck "check for updated files".
No idea if it will compile in 64 bit, let us know if it works.
Code Blocks claims the 64-bit TDM install is "invalid", so I guess it doesn't.
Here's a summary of the process to build with Code::Blocks
- Install TDM-32 from first installer (second installer works too, you just choose 32-bit) http://tdm-gcc.tdragon.net/download
- Install Code::Blocks *without mingw*, or go into Settings->Compile->Toolchain Executables and point it at your TDM-32 directory. The individual filenames still say mingw, but were fine as is for me. It seemed to auto-detect TDM-32 correctly when installed without bundled mingw.
- Open the "workspaces" directory, open game.cbp in Code::Blocks.
- Go to Project->Build Options->Linker Settings. Edit "-lncurses" to "-lpdcurses".
- Do the build (:
- Final bit of weirdness... Hitting run, it will claim the project hasn't been built. You have to decline to build it, then it will actually run. If you say yes, it'll build, then ask again... Which is bizarre but useful.
Maybe related to that last thing, the built .exe is found in the src directory, but it won't work there. Has to be copied up a level so it can find the .dlls (and various assets I assume). Seems like that it would be easy to leave in the correct directory instead, but I'm pretty clueless with workspaces and Makefiles and C++ in general. It's weird to me that the IDE somehow runs it at all, temporary environment variables I guess.