project-navigation
Personal tools

Author Topic: Building 2.5-dev with Code::Blocks and SDL 2  (Read 3866 times)

Offline Ragwortshire

  • Cannon Fodder
  • **
  • Posts: 7
    • View Profile
Building 2.5-dev with Code::Blocks and SDL 2
« on: September 17, 2013, 03:56:58 pm »
I'm having trouble building the current development version using Code::Blocks 12.11 on Windows 7, with an Intel Core i3 M350 processor. I don't have much experience with Code::Blocks, so it's possible I'm missing something very obvious, but here goes.

So far I've only tried to build ufo.exe. I eventually got the compiling and linking to go through, and got all the necessary .dll files, and so can successfully start the game. I can get to the main menu without problems. When I load a saved game, the geoscape briefly shows up before the program abruptly crashes.

I've attached my console log. Any idea what the problem could be, or what I should try to fix it?

UPDATE: When using SDL 1, this problem did not occur - thankfully! However I haven't tested the build thoroughly yet.

UPDATE: After rebuilding game.cbp, the battlescape now seems to work and I can do various base functions. Anything else that it's usually a good idea to test?




« Last Edit: September 17, 2013, 06:29:31 pm by Ragwortshire »

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Building 2.5-dev with Code::Blocks and SDL 2
« Reply #1 on: September 17, 2013, 11:06:03 pm »
Cool, please share the mingw package you used to build it with sdl2.

in general the battlescape is the main thing to test. if you got there via the ui and a map is loaded, most stuff should work fine.

regarding sdl2 especially the input should get tested.

Offline Ragwortshire

  • Cannon Fodder
  • **
  • Posts: 7
    • View Profile
Re: Building 2.5-dev with Code::Blocks and SDL 2
« Reply #2 on: September 18, 2013, 02:31:48 pm »
Here is what I did, to the best of my memory:

 - Installed Code::Blocks 12.11.
 - In the Code::Blocks settings, set it to use mingw32 which I had installed previously. For some reason I can't find my mingw32 version, but my msys version is 1.0.
 - Downloaded the Code::Blocks package from the wiki (http://ufoai.org/wiki/Code::Blocks)
 - Opened the ufo.cbp project.
 - In Settings -> Compiler -> Search Directories, added MinGW\include, codeblocks\MinGW\include (from the wiki package) for the compiler and MinGW\lib, codeblocks\MinGW\lib for the linker.
 - In the linker settings, added -static-libgcc -static-libstdc++
 - Copied the dlls from the Code::Blocks package into MinGW\bin.

When I was trying to use SDL 2, I also did the following:
 - Added the paths for the SDL 2 headers to Compiler -> Search Directories for the compiler, and for the .a files to the linker.
 - Added -lSDL2main -lSDL2 -lSDL2_mixer -lSDL2_ttf to the linker settings.
 - Copied the SDL 2 dlls to MinGW\bin.