User Tools

Site Tools


en:tutorials:orx:linux:compiling-orx-linux

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:orx:tutorials:community:grey:setup_cl [2011/01/19 17:04 (13 years ago)] greyen:tutorials:orx:linux:compiling-orx-linux [2020/10/02 15:45 (4 years ago)] (current) – Removed freeglut iarwain
Line 1: Line 1:
-==== Tutorial 1: Setup Codelite on Linux ==== +<WRAP center round tip 60%> 
-[//This is ripped from the README and edited slightly for clarity//]+Marked for removal. Content is being broken up. 
 +</WRAP>
  
-Orx's core is basically platform-independent. All the platform/OS-dependent features are implemented via plugins. These plugins can be loaded at runtime (hotplug) or they can be embedded at link-time. 
  
-If you use the non-embedded versions, you'll have to specify which plugins to use. This is more flexible but also requires additional files (the plugins themselves). The embedded version will store everything in Orx'library, meaning you won't be able to choose which plugin to use at runtime, but in exchange, Orx will be more compact and will also run considerably faster.+====== Compiling the Orx library for Linux ======
  
-From the [[http://sourceforge.net/projects/orx/files/orx/|download]] page you'll find pre-compiled dynamic embedded binaries for Win32, Linux (x86) and MacOS X (ppc/x86)If you want to use the non-embedded versions (to use your own plugins) or the static ones, you will need to compile Orx yourself from the source. +This guide assumes that you have [[en:tutorials:orx:cloning_orx_from_github|cloned Orx from github]] and that the setup.sh script has been automatically run. You will receive a notice when the script completes that states:
-Everything compiles out-of-the-box for the hardware platforms cited above.+
  
-The embedded versions currently use:\\ +<code> 
-GLFW-based plugins for display, joystick, keyboard and mouse.\\ +== IMPORTANT - Make sure the following libraries are installed on your system
-OpenAL-based plugin for sound.\\ +==[ libsndfile1-dev ] 
-Box2D-based plugin for physics.\\ +==[ libopenal-dev ] 
-- homemade plugin for 2D rendering.\\+==[ libxrandr-dev ] 
 +</code>
  
-==== Codelite Linux ====+==== Install development libraries ====
  
-Download file is orx-dev-linux-1.2.tar.bz2 ( orx-dev-linux-* )+On linux, these dev libraries are sometimes missing from fresh installs. Or you might have only 64-bit or 32-bit versions of the following librariesYou'll need to add them using your favourite package manager (apt, yum, pacman, rpm etc...). In order to get the 64-bit libraries using something like Ubuntu:
  
-project root directory will be: ~/MyProject/+  * apt-get install libsndfile1-dev 
 +  * apt-get install libopenal-dev 
 +  * apt-get install libxrandr-dev
  
-For those who don't know, ~ refers to the HOME directory of the current user, so in this tutorial, my files will exist at /home/grey/MyProject/ )+And, if you want to distribute your game or application more widely, you might want to consider compiling on 32-bit. For that you'll need to install the 32-bit versions to your linux machine with:
  
-grab /bin/, /include/ and /lib/ from inside archive ( under <archive>/orx-1.2/dev-linux/ )+  * apt-get install libsndfile1-dev:i386 
 +  * apt-get install libopenal-dev:i386 
 +  * apt-get install libxrandr-dev:i386
  
-Please be awarethe files inside the archive are built with an older version of GCC and G++so they will be incompatible with current releases. (And you are certain to get an error when attempting to link against them in this case.) I am not sure if Iarwain was planning on updating the 1.2 release, if not, you may be required to build all the required files from the SVN yourself.+For other Linux flavourslike Fedorause the appropriate package manager command.
  
-==Now we will set up our workspace in Codelite==+<WRAP center round tip 60%> 
 +It seems that installing one version of the libraries, means automatically removing the other. You need multi-arch to be able to compile both 32 and 64-bit versions. If you are interested in doing this, go to: [[en:tutorials:orx:linux:setting_up_dev_on_linux|Setting up a Development Environment on Linux]] 
 +</WRAP>
  
-{{http://grey.orx-project.org/tutorial_data/tutorial_1/codelite/1.png}} 
  
-{{http://grey.orx-project.org/tutorial_data/tutorial_1/codelite/2.png}} 
  
-Apparently this popup will not allow us to use the tilde (~) symbol to represent our home address, so ~/MyProject/ in my case becomes /home/grey/MyProject/+When you compile all three configurations, you will see the following files in the /orx/code/lib/dynamicfolder:
  
-==Next we add our project files==+  * liborx.so 
 +  * liborxd.so 
 +  * liborxp.so
  
-{{http://grey.orx-project.org/tutorial_data/tutorial_1/codelite/3.png}} +And you have the three Orx libraries ready for use in your own projects.
- +
-{{http://grey.orx-project.org/tutorial_data/tutorial_1/codelite/4.png}} +
- +
-Again, we can'use the tilde symbol... guessing that's a feature which won't be changing. +
- +
-==Next we set up our general options== +
- +
-{{http://grey.orx-project.org/tutorial_data/tutorial_1/codelite/5.png}} +
- +
-Our project file is stored at ~/MyProject/project/ so in order to put things in the right place, we want ../bin/ which becomes ~/MyProject/bin/ +
- +
-{{http://grey.orx-project.org/tutorial_data/tutorial_1/codelite/6.png}} +
- +
-Same goes for release versions... +
- +
-==Compiler options next== +
- +
-{{http://grey.orx-project.org/tutorial_data/tutorial_1/codelite/7.png}} +
- +
-The default project will place a 'main.cpp' file inside the ~/MyProject/project/ folder. We can move this, but to keep things straight forward, we do not remove the current directory include (".;") and instead simply add another for our include folder ("../include;"+
- +
-{{http://grey.orx-project.org/tutorial_data/tutorial_1/codelite/8.png}} +
- +
-Release doesn't require the %%__orxDEBUG__%% preprocessor directive. (That's 2 underscores on the start and end by the way.) +
- +
-==Finally, linker steps== +
- +
-{{http://grey.orx-project.org/tutorial_data/tutorial_1/codelite/9.png}} +
- +
-{{http://grey.orx-project.org/tutorial_data/tutorial_1/codelite/10.png}} +
- +
-Please be careful to ensure the release version is liborx, not liborxD like the debugging version.+
en/tutorials/orx/linux/compiling-orx-linux.1295485460.txt.gz · Last modified: 2017/05/30 00:50 (7 years ago) (external edit)