Compile With Eclipse

From FreeOrionWiki
Revision as of 13:28, 5 December 2010 by Geoff the Medio (Talk | contribs) (Set Graphviz headers to Eclipse)

Jump to: navigation, search

Eclipse is open source multiplatform IDE comparable with Visual Studio.

Eclipse IDE for C/C++ Developers can be downloaded here. To compile FreeOrion with Eclipse it is required to install plugins for Eclipse to support:

  • subversion
  • python


Subversion plugin

Click on Help->Install New Software menu, select work with All Avalaible Sites and install Collaboration->Subversive SVN Team Provider.

Add update url(Help->Install New Software->Add) for subversion connector plugin in Eclipse. Install it via Subversive SVN Connectors-> and check:

  • Subversive SVN Connectors
  • SVNKit 1.3.x Implementation.

Python plugin

Add update url(Help->Install New Software->Add) for Pydev plugin in Eclipse. Install it for developing FreeOrion AI written in Python. PyDev->PyDev for Eclipse


Insert spaces for tabs

Under Window>Preferences>General>Editors>Text Editors turn on

  • Insert spaces for tabs

Under Window>Preferences>C/C++>Code Style->Edit change Tab Policy

  • Spaces only

Autorefresh project

Under Windows->Preferences->General->Workspace turn on

  • Refresh automatically

Changing minimum and maximum memory for Eclipse

Change eclipse.ini file with lines Xms(minimal memory) and Xmx(maximal memory) to



Turn automatic Eclipse updates on

Under Windows->Preferences->Install/Update->Automatic Updates turn on

  • Automatically find new updates and notify me
  • Download new updates automatically and notify me when ready to install them

Checkout from repository

Switch to SVN Repository Exploring perspective(Window->Open Perspective->Other) and add location

Select FreeOrion, use option using wizard and confirm. On the next screen, change project to C++, select Makefile project and confirm Hello World screen. After Eclipse downloads sources from subversion repository, switch to C++ perspective. Or look at nice manual [here]

After some changes in svn repository you can update it from Eclipse(project name->Team->Synchronize with repository and update file)

Install missing libraries and headers

Install GG to system

Compile in console GG and install it.

Set GG headers to Eclipse

Right click on project name and select Properties. Under C/C++ General->Paths and symbols->Includes->Gnu C++

add path where installed headers are(on Linux it is /usr/local/includes/GG)

Set Boost headers to Eclipse

Similarly add path where Boost headers are installed(on Linux it is /usr/includes/boost)

Set Ogre headers to Eclipse

Add path where Ogre headers are installed(on Linux it is /usr/local/include/OGRE)

Install pylint library for Python error checking

Ubuntu and Debian

Install with command:

(sudo) apt-get install pylint

Compile FreeOrion from Eclipse

Configuring Eclipse External Tools to using scons to compile

Run->External Tools->External Tools Configuration->Program and clicked with right mouse button New.

Update Location to where scons is installed. On Linux it is:


Update Working Directory via Browse Workspace and select directory where is FreeOrion

Clicked Apply.

How to configure eclipse cdt project using cmake is [here].

Running compile

First time, you have to compile FreeOrion from console because it will generate configuration and will compile correctly project. Then it is possible to compile FreeOrion with Eclipse. After changing some FreeOrion file in Eclipse, run scons via Eclipse External Tools and compile FreeOrion.

Run FreeOrion from Eclipse

Run->Run Configurations->C/C++ Application and clicked with right mouse button New.

Update Location to where C/C++ Application is installed with selecting Browse and find file freeorion(you have to compile FreeOrion first)

Clicked Apply and Run to test this configuration.