My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
HowToCompile  
Guide for developers on how to compile CorsixTH.
Phase-Deploy, Featured
Updated Feb 19, 2012 by cgja...@gmail.com

Prerequisite Applications

In order to compile CorsixTH, the following applications need to be installed:

Application Status Windows Example Linux Example OSX Example Notes
CMake Required CMake Win32 installer CMake Unix/Linux source CMake OSX Universal Version 2.8.3 or later is required.
C++ compiler Required Visual Studio g++ Xcode The compiler must support C++ templates, which all modern compilers do.
Subversion client Optional TortoiseSVN svn Xcode Whilst technically optional, a subversion client is highly recommended.

Prerequisite Libraries

Before compiling, the following development libraries need to be installed:

Library Minimum Version Windows Linux / OSX Notes
SDL 1.2 Required Required Required even when using DirectX9 or OpenGL for rendering.
Lua 5.1 Required Required LuaJIT can be used instead. Lua 5.2 is not officially supported (or officially released) at the moment.
LuaJIT 1.1 Optional Optional LuaJIT 1 only supports x86. LuaJIT 2 should also work (and will support x64 in the future), but is not officially supported.
SDL_mixer 1.2 Optional Optional If not present, then there will be no audio.
wxWidgets 2.8 / 2.9.2 Optional Optional Required to build the AnimView and MapEdit tools, but not the game itself. Furthermore, MapEdit requires version 2.9.2 or later.
FreeType2 2.4.0 (?) Optional Optional Required for font support beyond the original game's bitmap fonts. Hence required for translations like Russian and Chinese.
Windows Platform SDK Any Optional Not required Microsoft compilers come with the platform SDK already included. Required for DirectX9 renderer.
DirectX SDK August 2004 (DX9) Optional Not required SDL can be used as the rendering engine, even on Windows, making DirectX9 optional.
Timidity Any Not required Optional If not present on Linux, then background MIDIs may not be played.

Getting the source code

The very latest source code can be checked out from the Subversion repository. With a command line Subversion client, the required command is:

svn checkout http://corsix-th.googlecode.com/svn/trunk/ corsix-th-read-only

If using a graphical Subversion client (for example, TortoiseSVN), then instruct it to checkout http://corsix-th.googlecode.com/svn/trunk/.

If you do not have a Subversion client, then the source code of the most recent release is available as a tarball from the downloads page, or a tarball of the subversion repository is also available.

Compiling

Compiling on Linux

The following commands may be suitable for installing the prerequisites; consult your distribution's package manager for full details, or alternatively, build the prerequisites from source.

For Ubuntu/Debian-based distributions:

sudo apt-get install build-essential
sudo apt-get install cmake
sudo apt-get install liblua5.1-0-dev
sudo apt-get install libsdl1.2-dev
sudo apt-get install libsdl-mixer1.2-dev
sudo apt-get install timidity

For Arch Linux:

sudo pacman -Sy base-devel cmake lua sdl sdl_mixer timidity++

Assuming that you have the prerequisites, and <checkout-path> is the top-level directory of CorsixTH source code (which should contain a file called CMakeLists.txt, and subdirectories called AnimView, CorsixTH, LFS, etc.), then the following commands should compile and run CorsixTH:

cd <checkout-path>
cmake .
cd CorsixTH
make
./CorsixTH

If you do not have SDL_Mixer installed, then use the following command for CMake instead of the above:

cmake -D WITH_AUDIO=OFF .

In a similar vein, if you want to use the OpenGL renderer rather than the SDL renderer, then add -D WITH_OPENGL=ON to the cmake command line.

Compiling on Windows

Note: This section assumes usage of Visual Studio 2008 or Visual C++ Express 2008. Other versions of Visual Studio will be similar, and other compilers will be similar for CMake part.

After obtaining the prerequisites and source code, run the CMake (cmake-gui) application. For both the source code and binary directories, browse to the top-level directory of the CorsixTH source code (which should contain a file called CMakeLists.txt, and subdirectories called AnimView, CorsixTH, LFS, etc.). Next, press the Configure button, and choose the version of Visual Studio which you have installed (if you want a 64 bit build of CorsixTH, then choose the 64 bit version here), and then press Finish. You will get an error message like the one below - this is normal, so do not be alarmed.

Note: The express editions of Visual Studio do not include 64 bit compilers, even on 64 bit platforms. Hence if using an express edition, do not choose the 64 bit version of Visual Studio in CMake (If using an express edition, you'll also need to trim the CorsixTH.rc file to avoid error RC1015).

In order to continue, CMake needs to be told where certain libraries are:

  • LUA_INCLUDE_DIR - Browse to the src folder of the Lua 5.1 source code.
  • LUA_LIBRARIES / LUA_LIBRARY - Browse to the lua5.1.lib or similar created by compiling Lua 5.1.
  • SDLMAIN_LIBRARY - This can be left as SDLMAIN_LIBRARY-NOTFOUND.
  • SDLMIXER_INCLUDE_DIR - If you have the SDL_Mixer library, browse to the top-level SDL_Mixer directory.
  • SDLMIXER_LIBRARY - If you have the SDL_Mixer library, browse to the SDL_Mixer.lib file created by compiling SDL_Mixer.
  • SDL_INCLUDE_DIR - Browse to the include directory of the SDL source code.
  • SDL_LIBRARY_TEMP / SDL_LIBRARY - Browse to the SDL.lib file created by compiling SDL.
  • WITH_AUDIO - If you do not have the SDL_Mixer library, then untick this box.
  • WITH_DIRECTX - If you have the DirectX SDK, then tick this box and untick WITH_SDL.

Note that if the Lua settings do not appear, but you want to set them regardless, then changing the CMake dropdown from Simple View to Grouped View should reveal them.

Pressing Configure again should cause most of the red lines to become white, and the SDL_LIBRARY_TEMP line to become SDL_LIBRARY. Pressing Configure a second time should cause all lines to become white, and the Generate button to become enabled. Hence press the Generate button. If all went well, CMake should now be looking something similar to the following:

By pressing Generate, CMake will have produced a file called CorsixTH.sln within the CorsixTH subdirectory. Open this file with Visual Studio. Change the active configuration from Debug to Release in the normal way (the dropdown box on the toolbar), and then build the solution in the normal way (Build -> Build Solution (F7)).

This will create the file CorsixTH\Release\CorsixTH.exe. Note that if DLL versions of Lua, SDL, and/or SDL_mixer were used for compilation, then said DLLs will need to be copied to be alongside CorsixTH.exe.

Compiling on OS X

I'm going to focus on building a universal bundle here which will work on modern Intel Macs as well as the older PPC Macs. Lets do it from scratch. After you've downloaded the source, you need some tools:

LUA

You can obtain binaries of Lua from a number of different sources. From luabinaries, MacPorts, Fink and there's even a Lua framework available. However, most of these binaries were only compiled for Intel so I'm going to ignore them. That leaves us with two options, an easy option and a harder (but probably better) option.

The easiest option is to use the Lua framework mentioned above as, at time of writing, this uses a static library compiled for PPC as well as Intel. Simply download the "Framework only" option, extract the zip and place the Lua.framework folder in /Library/Frameworks.

The harder option is to compile Lua yourself from source. This is probably the better solution as it allows you to have direct control over which platforms to support etc. But you will have to make a few changes to the Lua Makefile. Below are the steps I used to compile and install a universal static lib of Lua:

1. Download and extract lua-5.1.4.tar.gz from the Lua website.

2. Open the lua-5.1.4/src/Makefile in your favourite text editor.

3. Find the line which looks like...

macosx:
	$(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-lreadline"

...and change it to look like...

macosx:
	$(MAKE) all MYCFLAGS="-DLUA_USE_MACOSX -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -arch ppc -arch i386 -arch x86_64" "MYLDFLAGS=-Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386 -arch x86_64 -mmacosx-version-min=10.5"

...then save it.

This configuration will build a static lib compatible with PPC and Intel on MacOS 10.5 and above. You should ensure that whatever platforms and OS version you choose here are the same ones you select in CMake later on to ensure they're compatible.

4. Open a terminal and change into the lua-5.1.4 directory (e.g "cd /Users/Username/Downloads/lua-5.1.4").

5. Type "make macosx" and press return. This should perform the actual build process.

6. Type "sudo make install" and press return (enter your password when prompted). Lua should now be installed. You can test this by doing "lua -v" which should report the version of Lua as 5.1.4.

SDL

Download SDL from the official SDL website (at time of writing SDL-1.2.14.dmg is the latest) and copy the SDL.framework folder to /Library/Frameworks.

SDL_Mixer

If we want audio ingame, we must install SDL_mixer.

Download SDL Mixer from the SDL mixer project website (at time of writing SDL_mixer-1.2.11.dmg is the latest) and copy the SDL_mixer.framework folder to /Library/Frameworks.

CMake and XCode

After you've installed the libraries above, you now need CMake. Download and install it. Download the latest binary distribution from http://cmake.org/cmake/resources/software.html, install the app and open the application.

1. While you're in the main window of CMake, you should click Browse Source... and select the root of the CorsixTH source (containing folders such as AnimView, LDocGen, LFS, MapEdit etc.).

2. Click Browse Build... and choose where you want the project to be created.

3. Now, click Configure and let CMake create folders if necessary.

4. You should select XCode as generator for the project and Use default native compilers

5. You should now get some red fields. That is normal. If you scroll the log in the bottom, you should check that SDL, Lua and SDL_mixer are found:

Building CorsixTH
  SDL found
  Lua 5.1 found
  SDL_mixer found
Configuring done

6. Try clicking Configure once more and the fields should now be white again. The log should look like:

Note: Using SDL as renderer (default)
Note: SDL audio is enabled (default)

Building CorsixTH
  SDL found
  Lua 5.1 found
  SDL_mixer found
Configuring done

7. Before generating the XCode project we should set some Mac specific CMake settings.

7.1. Set CMAKE_OSX_ARCHITECTURES to "ppc i386 x86_64" (or whichever architectures you want to support).

7.2. Set CMAKE_OSX_SYSROOT to "/Developer/SDKs/MacOSX10.5.sdk" (or whichever OS you want to support).
7.3. Set CMAKE_INSTALL_PREFIX to "/Applications" (or wherever you want to place redistributable bundles).
7.4. (Optional) Enable WITH_OPENGL. This is optional but I like to enable this because it allows the zoom feature.

8. Click Configure again to apply the changes and then click Generate to build the XCode project.

If SDL, LUA or SDL_mixer are not found, try to look into the log, see where the error is and ask someone for help in the IRC channel or on the forum. They are really helpful!

9. Navigate to the folder you selected in step 2 and it should now contain an XCode project file named CorsixTH_Top_Level.xcodeproj. Double click on this file to open it in XCode.

10. Test if compilation works by clicking Build and Run. If this completes successfully then you are ready to start developing, if that's what you wish to do.


IMPORTANT: The build produced in step 10 isn't a redistributable build that will work on other machines. It does not copy across the frameworks that would be required to run the build on a machine that doesn't have them installed.


To produce a redistributable build, perform these extra steps:

11. Select MinSizeRel as the active configuration from the drop-down box in the top left of XCode. MinSizeRel is preferable to just a normal Release build as it is much more aggressive with regards to code stripping and produces a much smaller executable, particularly in the case of MapEdit and AnimViewer which use wxWidgets.

12. Expand Targets in the Groups & Files section of XCode, right click on install and click Build "install". This will place a redistributable bundle in the folder selected in step 7.3 above.

If you can't get this to work, let us know...

Compiling MapEdit and AnimViewer

To be compile these tools you will first need to build and install wxWidgets.

wxWidgets

Version 2.9.2 or above is required but, at the time of writing, this version is yet to be released (TODO Update). As a result, you will have to get the latest code from SVN and use that instead. A couple of changes need to be made before the build too. The instructions below take you through this.

1. Open up a terminal, change to the directory you want to place the wxWidgets source folder and run "svn checkout http://svn.wxwidgets.org/svn/wx/wxWidgets/trunk wxWidgets". This will place a folder called wxWidgets in your current directory with the latest source code.

2. Open wxWidgets/configure in your favourite text editor and find this bit of code:

# FIXME: To remove some day.
if test "x$host_alias" != x; then
  if test "x$build_alias" = x; then
    cross_compiling=maybe
    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used." >&2
  elif test "x$build_alias" != "x$host_alias"; then
    cross_compiling=yes
  fi
fi

Directly after it put:

cross_compiling=yes

This will allow you to build a universal version of the libraries.

3. Open wxWidgets/setup.h.in in your favourite text editor and find this line:

#define wxDIALOG_UNIT_COMPATIBILITY   0

Directly after it put:

#define wxDEBUG_LEVEL 0

This will remove some debug features which stay present in a release build.

4. In the terminal window, ensure you are in the root of the wxWidgets directory and run the following command:

./configure --prefix=/usr/local --with-macosx-sdk=/Developer/SDKs/MacOSX10.5.sdk --with-macosx-version-min=10.5 --with-osx_cocoa --disable-shared --enable-universal-binary

5. Once the above has completed type "make" and press return. This will perform the build process and this can take quite a while.

6. Once building has finished type "sudo make install" and press return (enter your password when prompted).

wxWidgets should now be installed and you can build the map editor and anim viewer by following the "CMake and XCode" steps above, ensuring that BUILD_ANIMVIEWER and BUILD_MAPEDITOR are ticked. Note that, like the CorsixTH app, you will have to perform the extra steps to build redistributable versions of these tools.

Notes by others:

In terms of prerequisite libraries, Lua is fairly simple, whereas SDL is not quite so simple. For Lua, either use a system like MacPorts to install it, or make and compile an XCode dynamic library project (what is the exact term for a C (not Obj-C) dynamic library (not-framework) in XCode?) from all the files in the src directory of lua-5.1.4.tar.gz excluding lua.c, luac.c, and print.c.

For SDL, the easiest approach is to download and extract SDL-1.2.14.tar.gz. Then open a terminal/console/command-prompt window in the exacted directory, and enter the following three commands:

./configure
make
sudo make install

For SDL_Mixer, follow a similar process with SDL_mixer-1.2.11.tar.gz.

Common errors

CMake version check warning

If, when running CMake, you get (as part of the output) a warning like the one below:

CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as
    cmake_minimum_required(VERSION 2.8)
   should be added at the top of the file.

Then you are pointing CMake at the wrong directory. Ensure that CMake is using the top-level CorsixTH directory containing a single file named CMakeLists.txt, not the lower-level CorsixTH directory containing CMakeLists.txt, config.txt, CorsixTH.lua, etc.

Exit with status 255 on OS X

If after compiling, XCode reports error/status 255 when you try to run CorsixTH, then most likely there was an issue with your configuration file. Launch CorsixTH from a terminal to see what it was.

Comment by greg3...@gmail.com, Mar 25, 2010

A common error during the cmake for linux is that Lua5.0 is found instead of Lua5.1. This is a cmake bug, see http://www.cmake.org/pipermail/cmake-commits/2008-June/004179.html There is a typo in /usr/share/cmake/Modules/FindLua51?.cmake, you should replace Lua50 by Lua51

Comment by jorrit...@gmail.com, Mar 28, 2010

How do I compile SDL and SDL_mixer on Windows?

Comment by SyntheticDolphin@gmail.com, Mar 28, 2010

Use the links of the Mac section, the windows downloads are on the same site. It suggests they work in Visual c++, there are probably further instructions in the download.

Comment by jorrit...@gmail.com, Mar 29, 2010

The Windows binaries I downloaded only contain SDL.dll and SDL_mixer.dll respectively...

Comment by project member cor...@gmail.com, Mar 29, 2010

For SDL on Windows, you have 3 available downloads: http://www.libsdl.org/release/SDL-1.2.14.zip (or similar) - Source code. This must be compiled, and the result can be used to compile CorsixTH. http://www.libsdl.org/release/SDL-1.2.14-win32.zip (or similar) - Runtime library (DLL). This is useful only if you have already compiled CorsixTH. http://www.libsdl.org/release/SDL-devel-1.2.14-VC6.zip (or similar) - Development libraries. This can be used to compile CorsixTH.

Comment by jorrit...@gmail.com, Mar 29, 2010

Ok now I got past the CMake part, but when I try to build in Visual Studio I get this:

..\..\Source\CorsixTH\CorsixTH.rc(10) : fatal error RC1015: cannot open include file 'afxres.h'.

Comment by jorrit...@gmail.com, Mar 29, 2010

Alright, trimmed the resource file and I think I finally succeeded...

Comment by gifted...@gmail.com, Jun 18, 2010

Im on max snow leopard i dont know for others but its a a discouragement to try to do all this Ive been on this for hours now sorry i give up... try to bring this to life into a dmg or exe file point blank!!!

Comment by SyntheticDolphin@gmail.com, Jun 19, 2010

Macs do not have exes. It's not worth spending much time on this, just give it five minutes then look for binaries. Binaries here - http://www.mobstar.biz/openTH/forums/viewtopic.php?t=197&start=15 OR instructions here - http://www.mobstar.biz/openTH/forums/viewtopic.php?p=1431#1431

Comment by joshua.a...@gmail.com, Nov 7, 2010

I am having a problem. When I try to compile r1010 on Ubuntu 10.10 with all the prerequisite libraries installed, I get this error:

josh@GWMT6707:~/Downloads/corsix-th$ cmake . -- The C compiler identification is GNU -- The CXX compiler identification is GNU -- Check for working C compiler: /usr/bin/gcc -- Check for working C compiler: /usr/bin/gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done Note: Using SDL as renderer (default) Note: SDL audio is enabled (default) -- Looking for include files CORSIX_TH_HAS_STDINT_H -- Looking for include files CORSIX_TH_HAS_STDINT_H - found -- Looking for include files CORSIX_TH_HAS_MALLOC_H -- Looking for include files CORSIX_TH_HAS_MALLOC_H - found -- Looking for include files CORSIX_TH_HAS_ALLOCA_H -- Looking for include files CORSIX_TH_HAS_ALLOCA_H - found

Building CorsixTH -- Looking for include files CMAKE_HAVE_PTHREAD_H -- Looking for include files CMAKE_HAVE_PTHREAD_H - found -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE

SDL found
-- Found Lua51: /usr/lib/liblua5.1.so;/usr/lib/libm.so
Lua 5.1 found SDL_mixer found
-- Configuring done -- Generating done -- Build files have been written to: /home/josh/Downloads/corsix-th josh@GWMT6707:~/Downloads/corsix-th$ cd CorsixTH josh@GWMT6707:~/Downloads/corsix-th/CorsixTH$ make Scanning dependencies of target CorsixTH 3% Building CXX object CorsixTH/CMakeFiles/CorsixTH.dir/SrcUnshared?/main.cpp.o 6% Building C object CorsixTH/CMakeFiles/CorsixTH.dir/SrcUnshared?/SDL_main_win32.c.o 9% Building CXX object CorsixTH/CMakeFiles/CorsixTH.dir/Src/run_length_encoder.cpp.o In file included from /home/josh/Downloads/corsix-th/CorsixTH/Src/persist_lua.h:25,
from /home/josh/Downloads/corsix-th/CorsixTH/Src/run_length_encoder.cpp:24:
/home/josh/Downloads/corsix-th/CorsixTH/Src/th_lua.h:255: error: explicit template specialization cannot have a storage class /home/josh/Downloads/corsix-th/CorsixTH/Src/th_lua.h:260: error: explicit template specialization cannot have a storage class /home/josh/Downloads/corsix-th/CorsixTH/Src/th_lua.h:265: error: explicit template specialization cannot have a storage class make2?: [CorsixTH/CMakeFiles/CorsixTH.dir/Src/run_length_encoder.cpp.o] Error 1 make1?: [CorsixTH/CMakeFiles/CorsixTH.dir/all] Error 2 make: all? Error 2

If anyone could assist me to fix this I would greatly appreciate it!

Comment by project member roujin...@gmail.com, Nov 7, 2010

Judging from the error lines (th_lua.h:260, 265), r1011 might have fixed the problem.

Comment by joshua.a...@gmail.com, Nov 7, 2010

It appears it did fix it in r1011.

But now i get more errors farther in the process on r1012:

Scanning dependencies of target CorsixTH 3% Building CXX object CorsixTH/CMakeFiles/CorsixTH.dir/SrcUnshared?/main.cpp.o 6% Building C object CorsixTH/CMakeFiles/CorsixTH.dir/SrcUnshared?/SDL_main_win32.c.o 9% Building CXX object CorsixTH/CMakeFiles/CorsixTH.dir/Src/run_length_encoder.cpp.o 12% Building CXX object CorsixTH/CMakeFiles/CorsixTH.dir/Src/th_lua_anims.cpp.o 15% Building CXX object CorsixTH/CMakeFiles/CorsixTH.dir/Src/th_gfx_ogl.cpp.o 18% Building CXX object CorsixTH/CMakeFiles/CorsixTH.dir/Src/th_lua_sound.cpp.o 21% Building CXX object CorsixTH/CMakeFiles/CorsixTH.dir/Src/th_gfx_sdl.cpp.o 24% Building CXX object CorsixTH/CMakeFiles/CorsixTH.dir/Src/th_lua_gfx.cpp.o 27% Building CXX object CorsixTH/CMakeFiles/CorsixTH.dir/Src/rnc.cpp.o 30% Building CXX object CorsixTH/CMakeFiles/CorsixTH.dir/Src/th_lua_ui.cpp.o 33% Building CXX object CorsixTH/CMakeFiles/CorsixTH.dir/Src/th.cpp.o 36% Building CXX object CorsixTH/CMakeFiles/CorsixTH.dir/Src/sdl_core.cpp.o 39% Building CXX object CorsixTH/CMakeFiles/CorsixTH.dir/Src/xmi2mid.cpp.o 42% Building CXX object CorsixTH/CMakeFiles/CorsixTH.dir/Src/main.cpp.o 45% Building CXX object CorsixTH/CMakeFiles/CorsixTH.dir/Src/th_lua_strings.cpp.o 48% Building CXX object CorsixTH/CMakeFiles/CorsixTH.dir/Src/th_lua.cpp.o 51% Building CXX object CorsixTH/CMakeFiles/CorsixTH.dir/Src/sdl_wm.cpp.o 54% Building CXX object CorsixTH/CMakeFiles/CorsixTH.dir/Src/th_map.cpp.o 57% Building CXX object CorsixTH/CMakeFiles/CorsixTH.dir/Src/persist_lua.cpp.o 60% Building CXX object CorsixTH/CMakeFiles/CorsixTH.dir/Src/sdl_audio.cpp.o 63% Building CXX object CorsixTH/CMakeFiles/CorsixTH.dir/Src/th_pathfind.cpp.o 66% Building CXX object CorsixTH/CMakeFiles/CorsixTH.dir/Src/th_map_overlays.cpp.o In file included from /home/josh/Downloads/corsix-th-linux/CorsixTH/Src/th_gfx.h:25,

from /home/josh/Downloads/corsix-th-linux/CorsixTH/Src/th_map_overlays.h:25, from /home/josh/Downloads/corsix-th-linux/CorsixTH/Src/th_map_overlays.cpp:23:
/home/josh/Downloads/corsix-th-linux/CorsixTH/Src/th.h:45: error: ‘size_t’ has not been declared make2?: [CorsixTH/CMakeFiles/CorsixTH.dir/Src/th_map_overlays.cpp.o] Error 1 make1?: [CorsixTH/CMakeFiles/CorsixTH.dir/all] Error 2 make: all? Error 2

Is anyone else compliling on linux and getting these errors? I am using the latest version of cmake and g++ with the sources listed on the HowtoCompile? page. Thanks.

Comment by project member cor...@gmail.com, Nov 7, 2010

I do not regularly test compilation on Linux, mainly because if it fails, someone informs us fairly quickly. Try r1013, as that should fix what you reported.

Comment by joshua.a...@gmail.com, Nov 7, 2010

r1013 fixes the above comment, CorsixTH now compiles well in Ubuntu 10.10. Thanks!

Comment by jldod1%s...@gtempaccount.com, Nov 18, 2010

I'm working on a Mac OS X, I downloaded the Beta 4 Source version and ran through Cmake, which worked fine. The problems came when I attempted to use Xcode. The first time it said 'build failed with 42 errors'. The second time there were 1383 errors. The third time it worked but it didn't say 'CorsixTH has exited with status 255'. I still got an executable unix file though, so I copied this into my source folder, but I have no config.txt file. Was that supposed to be created at some point during the build process, or was it supposed to be part of the download? Because mine just isn't there. Also, since mine is an OS X 10.6, I originally tried the Beta 4 version that didn't need to be built, but when I ran the executable file it said 'image not found'. I have a windows version of theme hospital that works fine on my (now broken) PC, but it doesn't have an install file. Can anyone help me?

Comment by project member edvin.li...@gmail.com, Nov 19, 2010

You shouldn't have to worry about a config file. If it doesn't exist on startup it is created automatically. The problem is that none of us in the main development group use Mac, so we rely on friendly helpers to try it out on Mac...

Comment by jldod1%s...@gtempaccount.com, Nov 19, 2010

Ok thanks, I just assumed that it wouldn't work if I couldn't do step 12 but I tried opening it and it worked fine.

Comment by onethink...@gmx.de, Dec 18, 2010

I got the following error-message (see below). Everything worked fine - red lines are gone as described in the wiki. Can't press the generate button.

Building CorsixTH

SDL found
CMake Error at D:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs?.cmake:91 (MESSAGE):
Could NOT find Lua51 (missing: LUA_LIBRARIES LUA_INCLUDE_DIR)
Call Stack (most recent call first):
D:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs?.cmake:252 (FPHSA_FAILURE_MESSAGE) D:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindLua51?.cmake:72 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) CorsixTH/CMakeLists.txt:90 (FIND_PACKAGE)

Configuring incomplete, errors occurred!

Comment by project member jorge...@gmail.com, Jan 31, 2011

You should update the OS X compilation guide with information about homebrew, an alternative to ports. With homebrew, you can just do this to install the dependencies: brew install sdl sdl_mixer lua

Comment by crispyg...@gmail.com, Feb 16, 2011

For the Linux instructions, you can actually put multiple package names on the apt-get commandline, and it'll install them all in one go:

sudo apt-get install build-essential cmake liblua5.1-0-dev libsdl1.2-dev libsdl-mixer1.2-dev timidity

Comment by wainwright.alex@gmail.com, Mar 24, 2012

In case anyone has the same issue as me, I got the following error:

CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:
  Could NOT find Freetype (missing: FREETYPE_LIBRARY FREETYPE_INCLUDE_DIRS)
Call Stack (most recent call first):
  /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:252 (_FPHSA_F
  /usr/share/cmake-2.8/Modules/FindFreetype.cmake:92 (FIND_PACKAGE_HANDLE_STANDA
  CorsixTH/CMakeLists.txt:141 (FIND_PACKAGE)

And I managed to get it compiling (at least) by installing vflib3-dev:

sudo apt-get install vflib3-dev
Comment by william....@frog.za.net, May 20 (6 days ago)

I get the following error

make2?: No rule to make target /usr/lib/libSDLmain.a', needed by CorsixTH/CorsixTH'. Stop. make1?: [CorsixTH/CMakeFiles/CorsixTH.dir/all] Error 2 make: all? Error 2


Sign in to add a comment
Powered by Google Project Hosting