Building IndieLib

From IndieLib
Jump to: navigation, search

Tools needed

Any git client on your machine. I.e:

Library dependencies

Windows

Visual Studio 2012 Visual Studio 2012 is the supported project versions by Indielib team.

1) Clone the master branch from GitHub.

2) Install DirectX SDK if you want to compile DirectX render. Install it from MSN: http://msdn.microsoft.com/en-us/directx/aa937788

3) Download and install Microsoft Visual Studio C++ 2012 Express, or use your licensed copy.

4) When building for DirectX, check this to configure environment properly: http://fubnuts.wordpress.com/2012/12/31/starting-out-with-directx-9-and-visual-studio-2012/

5) Compile dependencies:

       Compiling FreeImage:
       A. Go to  <repo root>\common\dependencies\FreeImage\
       B. Open FreeImage.2008.sln with VS2012
       C. Convert project files automatically as needed.
       D. Compile ONLY the target FreeImageLib
       E. You do that by right-clicking on it -> rebuild (for debug and release)
       F. Lib is put automatically on directory already referenced by Indielib.
       Compiling SDL-2.0:
       A. Go to  <repo root>\common\dependencies\SDL-2.0\VisualC
       B. Open SDL_VS2012.sln
       C. Build the whole solution (Build -> Build solution) for release and debug
       D. Lib is put automatically on directory already referenced by Indielib.
       Compiling GLEW:
       A. Go to  <repo root>\common\dependencies\glew-xxx\build\vc10
       B. Open glew_static.dsp
       C. Agree for conversion of project if needed
       D. Compile the solution, Debug and Release DO NOT BUILD NOT Debug MX and Release MX
       E. Lib is put automatically on directory already referenced by Indielib.
       F. When closing project, no need to save changes
       Compiling FreeType:
       A. Go to  <repo root>\common\dependencies\freetype-x.x.x.x\builds\vc2010
       B. Open freetype.sln
       C. Agree for conversion of project if needed
       D. Compile the solution, Debug and Release.
       E. Lib is put automatically on directory already referenced by Indielib.
       F. When closing project, no need to save changes

5) Open the solution under <sources>/win/ named Indielib.sln.

6) Change preprocessor definition to change renderer (GL or DX).

  - There are 2 definitions compatible in Windows: INDIERENDER_OPENGL and INDIERENDER_DIRECTX
  - You can change it inside the project settings:(right-click on Indielib)->Settings->C/C++->Preprocessor->(Preprocessor Definitions)
  - Or you can override the settings by uncommenting the prepared lines in IndiePlatforms.h 
  - By default repository is configured to build OpenGL renderer on Windows.

7) Build the entire Indielib solution, all should work fine :)

NOTE

  • I've struggled to make VS2012 to install properly with all headers and C runtime needed to compile ANYTHING. If you run into problems when linking to C runtime libraries, or not finding C/C++ standard headers. And you can workaround this problem, as I did, by installing in a fresh windows machine, or virtual machine, VS2012 express, and copying over the install directory :(. Read these for more help:

http://social.msdn.microsoft.com/Forums/vstudio/en-US/a987f4fa-676f-4fda-ab69-2c6bcc2684c3/visual-studio-c-2012-standard-header-files-are-missing https://connect.microsoft.com/VisualStudio/feedback/details/795074/vs2012-installer-does-not-copy-the-c-headers-libraries-vc-librarycore-if-vs2010-is-present http://stackoverflow.com/questions/12184065/visual-studio-2012-no-c-header-installed


http://permalink.gmane.org/gmane.comp.lib.opencv/39163 http://opencv-users.1802565.n2.nabble.com/Visual-Studio-2010-the-famous-quot-exited-with-code-1072365566-0xc0150002-quot-help-td5358661.html

Linux

1) Clone the master branch from GitHub.

2) Build SDL - Go to SDL folder and run:

  ./configure
  make
  sudo make install

3) Build FreeImage - Go to FreeImage folder and run:

  make
  sudo make install

4) Build glew - Go to GLEW folder and run:

  make
  sudo make install

5) Go to the linux folder :

 autoreconf
 sudo ./configure --prefix=/home/michael/indielib/IndieLib
 make clean all

NOTE

  • Glew have some library dependencies, - if you don't have them installed (and you probably don't, just install them via your distros packetmanager) the linker will complain. For apt-based packetmanager:
 sudo apt-get install libx11-dev libxmu-dev libxi-dev
 sudo apt-get install libgl1-mesa-dev libglu-dev
  • The --prefix= is the topfolder where you have check out the indielib repository, change it to your local path. i.e:
 Repo checked out in ~/Desktop/projects/indielib-crossplatform
 Path to linux build dirs: ~/Desktop/projects/indielib-crossplatform/Indielib/linux
 Prefix will be: ~/Desktop/projects/indielib-crossplatform/Indielib/
  • If your SDL builds + installs correctly, but you get an error stating that the system can't find your libSDL2.so file, the try the following:
 LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
 export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

Mac OSX

For less problems, build on latest OSX version, Mavericks as of this writing.

1) Clone the master branch from GitHub.

2) Install latest XCode from App Store

3) Ensure XCode command line tools are installed, run:

   xcode-select --install

4) On Max OSX Mountain Lion (10.8) or later, you need to install X11 from here. This is due Mountain Lion and XCode 4.4 and higher don't include X11 anymore in the system. X11 is needed for SDL. You should install in default location, but if you have problems, bear in mind that X11 include path is specified in XCode settings via User search paths.

5) Use build script to build dependencies automatically, found in <reporoot>Indielib/mac. The dependencies will be installed where XCode project references them. Do:

   cd Indielib/mac
   ./builddependencies.sh

6) Open IndielibOSX.xcworkspace

7) Build desired target - Generally you would build Indielib or the tests target - IndielibTests

8) When building Indielib, it installs it in repo bin directory: <reporoot>/bin/mac.

NOTE

  • If in step 4, configure complains with a message like "configure: error: no acceptable C compiler found in $PATH" you need to install Command Line Tools for Xcode from Apple's developer page. or inside XCode preferences->Downloads

iOS

For less problems, build on latest OSX version, Mavericks as of this writing.

1) Clone the master branch from GitHub. (At time of writing the ios code is located in the gles2ios branch, but will be merged)

2) Install latest XCode from App Store

3) Ensure XCode command line tools are installed, run:

   xcode-select --install

4) Use build script to build dependencies, found in <reporoot>Indielib/ios . The dependencies will be installed where XCode project references them. Do:

   cd Indielib/ios
   ./builddependencies.sh

5) Open indielibios.xcworkspace

6) Build desired target - Generally you would build Indielib or the tests target - IndielibTests. When building Indielib, it installs it in repo bin directory: <reporoot>/bin/ios

7) When building Indielib, it installs it in repo bin directory: <reporoot>/bin/ios

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox