Code::Blocks
From UFO:AI
It's recommend to use the prepackaged version!
Contents |
General
We have project files and a workspace (ufo.workspace) in our SVN.
- See build/projects
Just hit Ctrl F9 to compile or Ctrl F11 to recompile all.
There is a small step-by-step tutorial in the Code::Blocks wiki that describes how to install the latest Code::Blocks version: Wiki link
You can do the Code::Blocks (C::B) installation in two ways (see below on how to perform the installation steps):
- Using the prepackaged version
- Setting up your development environment by manual download of DevPaks
Please also make sure to add the MinGW\bin directory to your path variable - otherwise you won't be able to compile the po files with the included batch file.
Prepackaged version
You also can use our prepackaged version which also comes with mingw and all needed libs to compile UFO:AI: Codeblocks_install.zip. You just have to set the Search dirs to the MinGW path.
- extract the archive to c:\developement\
- open C::B
- go to Settings->Compiler and debugger
- select gcc
- select Search directories tab
- add c:\developement\mingw\include to Compiler search dirs
- add c:\developement\mingw\include\SDL to Compiler search dirs
- add c:\developement\mingw\include to Ressource search dirs
- add c:\developement\mingw\lib to Linker search dirs
- select Toolchain executables tab
- change the compilers installation directory to c:\development\mingw
- go to Settings->Editor...
- in TAB options:
- Use TAB character must be set
- TAB indents must be set
- TAB size in spaces: must be 4
- copy the dynamic libraries from ../../contrib/ to a directory in your path.
Now you are ready to open the UFO:AI workspace file and compile the game.
(..\Ufo-AI\build\projects\ufo.workspace -- Where Ufo-AI is root dir, where the svn files where copied)
Before starting to compile the game check after loading the workspace file, if the following build option is set properly! If you don't do, there is no guarantee that the UFO-AI texts are compiled and placed where they should be!
- enter the compile options: Project->Build options...
- in the popping up window go to: ufo->windows
- go to Tab: Pre/post-build steps
- in section "Post-build steps" look at
..\..\contrib\scripts\compile_po.bat "C:\MinGW\bin\msgfmt.exe"
- change "C:\" to that, where you placed MinGW, or keep it when it's OK!
Now texts should compile too.
Setting up your development environment
You have to install some header files and lib files for Code::Blocks in order to be able to compile UFO.
- SDL Library (1.2.10 or greater) [homepage]
- SDL_ttf (2.0.7 or greater) [homepage] [DevPak 2.0.7] [DevPak 2.0.8]
- SDL_mixer (1.2.7 or greater) [homepage] [DevPak 1.2.7]
- libjpeg 6b-4 [homepage] [DevPak 6b-4]
- zlib (1.2.3 or greater) [homepage] [DevPak 1.2.3]
- libpng 1.2.8 [homepage] [DevPak 1.2.8]
- libcurl [homepage] [DevPak 7.14.0]
- libintl [homepage] [DevPak 0.14.5]
Code::Blocks supports devpaks (Dev-CPP MinGW-Packages) - but not all files are available as devpak. Start the Dev-CPP plugin from the Code::Blocks menu and search in the list for all of the above given packages. For those you can't find you have to do some steps manually. Visit the library homepage and grab the development packages. Extract them to some directory on your harddisk and add these paths to the Code::Blocks linker and include directories.

