[HOWTO] Compiling under Ubuntu

33 replies [Last post]
banana.boy
User offline. Last seen 15 years 26 weeks ago. Offline
Joined: 2008-02-03
Posts: 25

This is how to compile under Ubuntu 8.04 :

Install the required packages :
$ sudo apt-get install libqt4-dev fpc libsdl1.2-dev libsdl-net1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libsdl-ttf2.0-dev cmake
Get in your hedgewars-src folder in the terminal and type :

$ cmake .
$ make
$ make install

I hope this will be useful, although it's not a lot more detailed than the FAQ. Big Grin

superBOB
User offline. Last seen 16 years 12 weeks ago. Offline
Joined: 2008-09-01
Posts: 3

Hi

I'm a newbie. Where should one install the files ?
I've put them in Documents and this is what happened.

nicholas@nicholas-desktop:~/Documents/hedgewars-src-0.9.6$ cmake .
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Check size of void*
-- Check size of void* - done
-- Check for working CXX compiler: CMAKE_CXX_COMPILER-NOTFOUND
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: Internal CMake error, TryCompile configure of cmake failed
-- Check for working CXX compiler: CMAKE_CXX_COMPILER-NOTFOUND -- broken
CMake Error: The C++ compiler "CMAKE_CXX_COMPILER-NOTFOUND" is not able to compile a simple test program.
It fails with the following output:

CMake will not be able to correctly generate this project.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
-- Configuring done

banana.boy
User offline. Last seen 15 years 26 weeks ago. Offline
Joined: 2008-02-03
Posts: 25

Try installing libcxxtools-dev and tell us if it works. Wink Smiley

$ sudo apt-get install libcxxtools-dev

unC0Rr
unC0Rr's picture
User offline. Last seen 11 weeks 2 days ago. Offline
Joined: 2006-11-27
Posts: 576
superBOB
User offline. Last seen 16 years 12 weeks ago. Offline
Joined: 2008-09-01
Posts: 3

banana.boy allegedly wrote:
Try installing libcxxtools-dev and tell us if it works. Wink Smiley

$ sudo apt-get install libcxxtools-dev

Here's the result :

-- Check for working CXX compiler: CMAKE_CXX_COMPILER-NOTFOUND
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: Internal CMake error, TryCompile configure of cmake failed
-- Check for working CXX compiler: CMAKE_CXX_COMPILER-NOTFOUND -- broken
CMake Error: The C++ compiler "CMAKE_CXX_COMPILER-NOTFOUND" is not able to compile a simple test program.
It fails with the following output:

CMake will not be able to correctly generate this project.
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
-- Configuring done

Beernutz
User offline. Last seen 15 years 50 weeks ago. Offline
Joined: 2008-09-15
Posts: 6

Hey all, i'm kinda new, especially to manually compiling things, and I'm having trouble with getting this to work. I've tried a bunch of different suggestions to install, but they all get hung up when apt-get is trying to get certain packages (libqt4-dev, fpc, fp-units-gtk, maybe more). An error comes back reading:

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:
fp-units-gtk: Depends: libgtk2.0-dev but it is not going to be installed
E: Broken packages

Can anyone help? I tried installing the packages that it said the ones needed were dependent upon, but that doesn't help...derr...

daimadoshi85
daimadoshi85's picture
User offline. Last seen 13 years 37 weeks ago. Offline
Joined: 2008-05-04
Posts: 372

I saw you tried the zenity script. Can you tell me the errors it gave you? fp-units-gtk is not required. Are you using ubuntu?

Reading your previous post I think you should do a 'apt-get clean' and then try to reinstall the game from the zenity script. Please execute the script with a terminal and post here all the output. Thank you!

Come to the dark side, we have cookies... - V

Hedgewars script for ubuntu is here...but maybe I have to update it first Smile

Beernutz
User offline. Last seen 15 years 50 weeks ago. Offline
Joined: 2008-09-15
Posts: 6

Yes, I am using ubuntu (hardy). I did an "apt-get clean" as you said, and ran the zenity script. I chose "Install libraries and compilers", it tried, stopped with an error output:

E: Broken packages.

Ok. I click install and it downloads a bunch of files, ending with:

Checked out revision 1291.
-- 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
CMake Error at /usr/share/cmake-2.6/Modules/FindQt4.cmake:1421 (MESSAGE):
Qt qmake not found!
Call Stack (most recent call first):
QTfrontend/CMakeLists.txt:11 (find_package)

-- Configuring done
make: *** No targets specified and no makefile found. Stop.
make: *** No rule to make target `install'. Stop.

Then it says in zenity: "Installation complete!" but clearly its not because when i try to run it, it won't, and when i try to do anything else in the script it tells me to install hedgewars. i take it i don't have qt4? Any insight? apologies in advance for not understanding this stuff.

EDIT: when trying to download libqt4-dev in an attempt to solve this problem, the problem i stated in my previous post occurred, meaning the package had unmet dependencies, etc. etc.
E: Broken packages.

daimadoshi85
daimadoshi85's picture
User offline. Last seen 13 years 37 weeks ago. Offline
Joined: 2008-05-04
Posts: 372

The problem is rightfully that "E: Broken packages", but with apt-clean it should be solved (does it download again libqt4-dev or not?the package should be redownloaded). Else try "sudo apt-get -f install".
Can you copy here all the output of terminal when you choose "Install libraries and compilers"?

Come to the dark side, we have cookies... - V

Hedgewars script for ubuntu is here...but maybe I have to update it first Smile

szczur
szczur's picture
User offline. Last seen 3 years 5 weeks ago. Offline
Joined: 2008-06-13
Posts: 182

@Beernutz

Choose Edit ▸ Fix Broken Packages from the menu.
Apply the marked changes to actually fix the packages:
Click on Apply in the toolbar.
You will be asked for confirmation. Check the summarized changes that will be applied.
To continue with the actual repair confirm the changes click on Apply
During the processing of the changes you will see a progressbar. Wait until
the changes have been applied. This can take some time depending on the number
of changes. Afterwards you will be returned to the main window.

Press any key to continue, or any other key to cancel.

Beernutz
User offline. Last seen 15 years 50 weeks ago. Offline
Joined: 2008-09-15
Posts: 6

@ Magik_18l

I've tried that method, sadly it does nothing. No packages get marked, there's nothing to apply. Perhaps synaptic doesn't recognize the packages as broken. In any case, I can't fix those packages. Thank you for the tip though!

@dalmadoshi85

I ran apt-get clean, and autoclean, but it still won't download libqt4-dev, with the same error:

gilmour@Weiner-Dog:~$ sudo apt-get -f install libqt4-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
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.

Since you only requested a single operation it is extremely likely that
the package is simply not installable and a bug report against
that package should be filed.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
libqt4-dev: Depends: libglib2.0-dev but it is not going to be installed
Depends: libxi-dev but it is not going to be installed
E: Broken packages

Perhaps i just have to wait until someone out there in the world fixes this? Perhaps report it like it suggests? I dunno..

Unfortunately, there is no more output than:

"E: Broken packages"

when I choose the "libraries and compilers" option. I click on it, enter password, it tries to do its thing, that error line comes up in the terminal and the script window just gives the option to click OK, as if the process completed as it should.

Ack!

daimadoshi85
daimadoshi85's picture
User offline. Last seen 13 years 37 weeks ago. Offline
Joined: 2008-05-04
Posts: 372

uhmm...ok, Try this commands in terminal then copy all the output here (just to be sure):

sudo apt-get clean
sudo apt-get autoclean
sudo apt-get update
sudo apt-get -f install
sudo apt-get --fix-broken install
sudo apt-get libqt4-dev libxi-dev libglib2.0-dev

with this commands it should solve the problem I think. Give me feedback.

PS. I'll solve that bug in the script Smile

Come to the dark side, we have cookies... - V

Hedgewars script for ubuntu is here...but maybe I have to update it first Smile

banana.boy
User offline. Last seen 15 years 26 weeks ago. Offline
Joined: 2008-02-03
Posts: 25

Hi !
I'm reporting a compiling bug : since I got SVN revision1293, I can't compile.

HHHandlers.inc(169,101) Error: Wrong number of parameters specified for call to "AddGear"
uGears.pas(1474) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Error: /usr/bin/ppc386 returned an error exitcode (normal if you did not specify a source file to be compiled)

It's because of the new HHHandlers.inc from revision 1293, obviously.

daimadoshi85
daimadoshi85's picture
User offline. Last seen 13 years 37 weeks ago. Offline
Joined: 2008-05-04
Posts: 372

I have the same error. Now hope in developer's answer Smile

Come to the dark side, we have cookies... - V

Hedgewars script for ubuntu is here...but maybe I have to update it first Smile

unC0Rr
unC0Rr's picture
User offline. Last seen 11 weeks 2 days ago. Offline
Joined: 2006-11-27
Posts: 576

It's SVN, don't expect it to be always compilable or playable

daimadoshi85
daimadoshi85's picture
User offline. Last seen 13 years 37 weeks ago. Offline
Joined: 2008-05-04
Posts: 372

You're right Smile

Come to the dark side, we have cookies... - V

Hedgewars script for ubuntu is here...but maybe I have to update it first Smile

Beernutz
User offline. Last seen 15 years 50 weeks ago. Offline
Joined: 2008-09-15
Posts: 6

Well, here's the complete output of those commands daimadoshi:

gilmour@Weiner-Dog:~$ sudo apt-get clean
[sudo] password for gilmour:
gilmour@Weiner-Dog:~$ sudo apt-get autoclean
Reading package lists... Done
Building dependency tree
Reading state information... Done
gilmour@Weiner-Dog:~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
gilmour@Weiner-Dog:~$ sudo apt-get --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
gilmour@Weiner-Dog:~$ sudo apt-get libqt4-dev libxi-dev libglib2.0-dev
E: Invalid operation libqt4-dev
gilmour@Weiner-Dog:~$ sudo apt-get install libqt4-dev libxi-dev libglib2.0-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
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:
libglib2.0-dev: Depends: libglib2.0-0 (= 2.16.4-0ubuntu3) but 2.18.0-1 is to be installed
libxi-dev: Depends: libxi6 (= 2:1.1.3-1) but 2:1.1.3-1ubuntu2 is to be installed
E: Broken packages

Err..... :/

daimadoshi85
daimadoshi85's picture
User offline. Last seen 13 years 37 weeks ago. Offline
Joined: 2008-05-04
Posts: 372

It's quite strange. And if you do only "sudo apt-get install libqt4-dev" what is the output? Because,if I have understood well, you have some dependencies too up-to-date and this has broken packages. And I don't understand why it needs these dependencies, I don't remember them.

Come to the dark side, we have cookies... - V

Hedgewars script for ubuntu is here...but maybe I have to update it first Smile

Beernutz
User offline. Last seen 15 years 50 weeks ago. Offline
Joined: 2008-09-15
Posts: 6

Here it is:

gilmour@Weiner-Dog:~$ sudo apt-get install libqt4-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
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.

Since you only requested a single operation it is extremely likely that
the package is simply not installable and a bug report against
that package should be filed.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
libqt4-dev: Depends: libglib2.0-dev but it is not going to be installed
Depends: libxi-dev but it is not going to be installed
E: Broken packages

Ack. I wonder, if there's nothing that you know of to help, is this something i should report? somehow?

daimadoshi85
daimadoshi85's picture
User offline. Last seen 13 years 37 weeks ago. Offline
Joined: 2008-05-04
Posts: 372

I want only to know two thing, you're system is updated?If you try to remove libglib2.0-0 how many packages should be removed? Because if it's it the problem, and it doesn't cause problems to the system removing it (for example if it says that it should remove a lot of packages), my idea is to remove and reinstall libglib2.0-0 at the previous version. Do you have some 3rd party repositories installed in sources.list?

Come to the dark side, we have cookies... - V

Hedgewars script for ubuntu is here...but maybe I have to update it first Smile

Beernutz
User offline. Last seen 15 years 50 weeks ago. Offline
Joined: 2008-09-15
Posts: 6

So, after an unfortunate accident which resulted in incapacitating my ubuntu installation, i wiped my linux partition and reinstalled ubuntu. The script works fine now. I wonder if the problem may have arisen due to some experimenting i did with kde4 and changes that may have made to certain packages. In any case, I really appreciate your patience and help with this, and now it's working fine! I'm sorry we couldn't figure it out exactly. Oh well.

Thanks again!

daimadoshi85
daimadoshi85's picture
User offline. Last seen 13 years 37 weeks ago. Offline
Joined: 2008-05-04
Posts: 372

Probably it was kde4, because you had libraries too up-to-date, and I was wondering why. Now I know why Smile
I updated the script the last days, I'll copy the link soon!See ya!

Come to the dark side, we have cookies... - V

Hedgewars script for ubuntu is here...but maybe I have to update it first Smile

banana.boy
User offline. Last seen 15 years 26 weeks ago. Offline
Joined: 2008-02-03
Posts: 25

I have a compiling error.

$ make
[  0%] Generating ../bin/hedgewars-server

Miscutils.hs:4:7:
    Could not find module `Control.Concurrent.STM':
      Use -v to see a list of the files searched for.
make[2]: *** [bin/hedgewars-server] Erreur 1
make[1]: *** [netserver/CMakeFiles/hedgewars-server.dir/all] Erreur 2
make: *** [all] Erreur 2

Does anybody else gets this ? Sad Smiley

daimadoshi85
daimadoshi85's picture
User offline. Last seen 13 years 37 weeks ago. Offline
Joined: 2008-05-04
Posts: 372

Yes Smile you need to install this packages from apt-get:
sudo apt-get install ghc libghc6-network-dev libghc6-stm-dev
Or, if you want, you can install this collection of script that contain a script to install hedgewars with zenity (it was mine, but now is integrated in that) from here. I'm sorry, for now the script is mostly in italian, but it's easy to install and use I think. If you encounter problems tell them to me Smile

Come to the dark side, we have cookies... - V

Hedgewars script for ubuntu is here...but maybe I have to update it first Smile

banana.boy
User offline. Last seen 15 years 26 weeks ago. Offline
Joined: 2008-02-03
Posts: 25

It worked, but libghc6-stm-dev wasn't in my repo, I had to download it from launchpad. Smile

daimadoshi85
daimadoshi85's picture
User offline. Last seen 13 years 37 weeks ago. Offline
Joined: 2008-05-04
Posts: 372

Strange, what version of ubuntu do you have?

Edit: Found the problem, to install libghc6-stm-dev you need to install ubuntu backport repositories from your package installer.

Come to the dark side, we have cookies... - V

Hedgewars script for ubuntu is here...but maybe I have to update it first Smile

spacebison
User offline. Last seen 1 year 48 weeks ago. Offline
Joined: 2008-12-22
Posts: 34

Hello

I been playing this game under Ubuntu 8.04 using the version in the repo, however it is out of date. I would like to play the current version but when following the above instructions I get an "E: Invalid operation libqt4-dev", also a link to the a script that was posted seems to be 404'ed. If anybody can help, thank you.

matt

daimadoshi85
daimadoshi85's picture
User offline. Last seen 13 years 37 weeks ago. Offline
Joined: 2008-05-04
Posts: 372

You need to set all updates available in repository (backports, universe, multiverse, and also updates proposed, not supported, etc). I updated that script, you can download it here. As I told before, it needs zenity, if it's not installed use apt-get to install it.

PS. I think that your error was because you haven't written 'sudo apt-get INSTALL libqt4-dev', but only 'apt-get libqt4-dev', so the command was invalid.

Come to the dark side, we have cookies... - V

Hedgewars script for ubuntu is here...but maybe I have to update it first Smile

Fabioamd87
Fabioamd87's picture
User offline. Last seen 15 years 21 weeks ago. Offline
Joined: 2007-04-29
Posts: 121

make[2]: *** No rule to make target `/usr/lib64/libSDL_mixer.so', needed by `bin/hedgewars'. Stop.
make[1]: *** [QTfrontend/CMakeFiles/hedgewars.dir/all] Error 2
make: *** [all] Error 2

but libsdl-mixer1.2-dev is installed...

daimadoshi85
daimadoshi85's picture
User offline. Last seen 13 years 37 weeks ago. Offline
Joined: 2008-05-04
Posts: 372

Are you using a 64 bit computer? I don't know if the script works with it. Maybe you can help me creating a script for it!

EDIT: Wait a moment, but it seems to be a problem with Makefile.Maybe Uncorr can tell us something..

Come to the dark side, we have cookies... - V

Hedgewars script for ubuntu is here...but maybe I have to update it first Smile

unC0Rr
unC0Rr's picture
User offline. Last seen 11 weeks 2 days ago. Offline
Joined: 2006-11-27
Posts: 576

Probably you should make a symlink /usr/lib64/libSDL_mixer.so to SDL_mixer library (which most probably has different name like libSDL_mixer.so.1)

banana.boy
User offline. Last seen 15 years 26 weeks ago. Offline
Joined: 2008-02-03
Posts: 25

Hi there !

I'm having trouble compiling the SVN since I got on Jaunty.

Gives me this :

Quote:
[ 1%] Building CXX object QTfrontend/CMakeFiles/hedgewars.dir/moc_game.cxx.o
/home/banana/sources/hedgewars/QTfrontend/moc_game.cxx:14:2: erreur: #error "This file was generated using the moc from 4.4.3. It"
/home/banana/sources/hedgewars/QTfrontend/moc_game.cxx:15:2: erreur: #error "cannot be used with the include files from this version of Qt."
/home/banana/sources/hedgewars/QTfrontend/moc_game.cxx:16:2: erreur: #error "(The moc has changed too much.)"
make[2]: *** [QTfrontend/CMakeFiles/hedgewars.dir/moc_game.cxx.o] Erreur 1
make[1]: *** [QTfrontend/CMakeFiles/hedgewars.dir/all] Erreur 2
make: *** [all] Erreur 2

But I have libqt 4.5 installed... weird !

nemo
nemo's picture
User offline. Last seen 19 weeks 3 days ago. Offline
Joined: 2009-01-28
Posts: 1861

that's an intermediate file left over from your QT4.4 build
do a make clean and you should be fine

could also run svn-clean I suppose, then cmake, but:
make clean

should be quite adequate

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

banana.boy
User offline. Last seen 15 years 26 weeks ago. Offline
Joined: 2008-02-03
Posts: 25

Thanks !

User login

Copyright © 2004-2024 Hedgewars Project. All rights reserved. [ contact ]