Problem compiling OIS

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Post Reply
Space Krill
Posts: 3
Joined: Mon Nov 03, 2014 8:18 pm

Problem compiling OIS

#1 Post by alex5161 »


I was trying to install FreeOrion on Ubuntu 13.10, but as I expected, I ran into problems.

I checked out the svn of FreeOrion and run through the instructions given here: ... _FreeOrion

The step to install orgre did not work:

sudo apt-get install libogre-dev
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
libogre-dev : Depends: libboost-date-time1.49-dev but it is not going to be installed
Depends: libboost-thread1.49-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
So I went on looking for something else and found this page:

which did not work in the Install OIS step, I got the following error:
./linux/LinuxJoyStickEvents.cpp: In member function 'virtual void OIS::LinuxJoyStick::capture()':
./linux/LinuxJoyStickEvents.cpp:100:77: error: 'read' was not declared in this scope
int ret = read(mJoyStick, &js, sizeof(struct input_event) * JOY_BUFFERSIZE);
./linux/LinuxJoyStickEvents.cpp: In static member function 'static OIS::JoyStickInfoList OIS::LinuxJoyStick::_scanJoys()':
./linux/LinuxJoyStickEvents.cpp:275:13: error: 'close' was not declared in this scope
./linux/LinuxJoyStickEvents.cpp:283:12: error: 'close' was not declared in this scope
./linux/LinuxJoyStickEvents.cpp: In static member function 'static void OIS::LinuxJoyStick::_clearJoys(OIS::JoyStickInfoList&)':
./linux/LinuxJoyStickEvents.cpp:294:20: error: 'close' was not declared in this scope
make[1]: *** [LinuxJoyStickEvents.lo] Error 1
make[1]: Leaving directory `/home/alexander/opt/src/ois-v1-3/src'
make: *** [all-recursive] Error 1

Any ideas how to fix that?

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12725
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Problem compiling OIS

#2 Post by Geoff the Medio »

I can't help with the compile issue, but I feel I should mention that in part due to a variety of issues with OIS, Ogre is being replaced with SDL. The SDL migration branch isn't really functional yet, though.

Space Krill
Posts: 3
Joined: Mon Nov 03, 2014 8:18 pm

Re: Problem compiling OIS

#3 Post by alex5161 »

So what are the steps to install FreeOrion then? How to install SDL? And how to tell cmake in FreeOrion to use SDL instead of ogre?

User avatar
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Problem compiling OIS

#4 Post by Dilvish »

although those OGRE instructions may suggest you compile OIS yourself, on Ubuntu 13.10 that is not actually necessary (I'm running on Ubuntu 13.10 myself), and I've edited our Linux instructions regarding OGRE to note that if libois-dev was successfully installed (it's part of the recommended packages at the beginning of the Ubuntu instructions) that it's not necessary to also do the OGRE-recommended step of compiling OIS. So assuming you did (or do) install libois-dev then just try skipping their OIS install step.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Space Squid
Posts: 89
Joined: Fri Apr 19, 2013 4:10 pm

Re: Problem compiling OIS

#5 Post by Apo »

See ... Debian_way

for building FreeOrion on Debian systems and derivatives like Ubuntu.

Just grab the latest source package from Vivid aka Ubuntu 15.04 with

Code: Select all

apt-get install build-essential

Code: Select all

dget -x
You need to install the build-dependencies by hand on Ubuntu 13.10 since there is no official package for this version of Ubuntu. (which is by the way no longer supported, please upgrade to a newer release)

You could also add the binary or source repository of newer Ubuntu releases to your /etc/apt/sources.list

Code: Select all

deb-src vivid universe
Then run

Code: Select all

apt-get update && apt-get source freeorion -t vivid
to obtain the sources of FreeOrion from Vivid and just follow the steps from ... Debian_way

Post Reply