Compilation question (Linux).

Discussion about Rocks'n'Diamonds, Boulder Dash, Supaplex, Emerald Mine and any other BD hybrid.

Moderators: Flumminator, Zomis

Post Reply
User avatar
Thalassius
Posts: 8
Joined: Mon Aug 17, 2015 2:09 pm

Compilation question (Linux).

Post by Thalassius »

Hi! :D

I was trying to compile RnD v.3.3.1.2 on my system (Mint 17.2 x64 KDE) with SDL2.
However when giving "make sdl2", I'm getting the error: "make: *** No rule to make target `sdl2'. Stop.".
Any hints??? :D

PS. Compiling with SDL v.1.2 ("make sdl") works as expected, so I already have a working copy of the latest version.
I'm asking just out of curiosity.
TIA!!! :D
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Compilation question (Linux).

Post by Holger »

Hello Thalassius, welcome to the R'n'D forum! :-)

Your question can easily be answered: There's no SDL2 support in version 3.3.1.2 yet, that's why "make sdl2" does not work.

To not only build R'n'D with SDL2 support, but also be able to use all the new features (like window and fullscreen scaling), please just use the current code from the Git repository by doing a "git clone http://git.artsoft.org/rocksndiamonds.git".

If you have SDL2 installed on your system, it should compile out of the box. (If not, please let me know.)

But you're right, it's finally time for a new, SDL2 based release version! :-)
User avatar
Thalassius
Posts: 8
Joined: Mon Aug 17, 2015 2:09 pm

Re: Compilation question (Linux).

Post by Thalassius »

Holger wrote:Hello Thalassius, welcome to the R'n'D forum! :-)
THANKS!!!
It's really nice to find you!!! :D
Holger wrote: please just use the current code from the Git repository by doing a "git clone http://git.artsoft.org/rocksndiamonds.git".

If you have SDL2 installed on your system, it should compile out of the box. (If not, please let me know.)
I couldn't compile it!
It misses the SMPEG library, although I have installed libsmpeg0 and libsmpeg-dev.
Here's the last part of console's output:

Code: Select all

/usr/bin/ld: cannot find -lsmpeg2
collect2: error: ld returned 1 exit status
make[1]: *** [../rocksndiamonds] Error 1
make[1]: Leaving directory `/home/giorgos/rocksndiamonds/src'
make: *** [sdl2] Error 2
Holger wrote:But you're right, it's finally time for a new, SDL2 based release version! :-)
Great! :D
THANKS for this amazing game and keep up the good work!!!
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Compilation question (Linux).

Post by Holger »

Oh well, the smpeg/smpeg2 library always makes some headaches... :-/

Please try the following: Remove the "-lsmpeg2" from the file "src/Makefile" (or directly try it on the command line by copy'n'pasting the last command that caused the error, which also contains the "-lsmpeg2", and remove that part).

As far as I can see it, the library "SDL_mixer2" dynamically loads the library "smpeg2" at run-time, so it may be possible that your (apparently package based) installation of the smpeg2 library does not allow direct linking against this library, but only dynamic link-loading by SDL_mixer2 at run-time. (As I have compiled all SDL2 libraries (including smpeg2) from source, things apparently behave differently here. Maybe it's really time for a "configure" script now... :-/ )
User avatar
Thalassius
Posts: 8
Joined: Mon Aug 17, 2015 2:09 pm

Re: Compilation question (Linux).

Post by Thalassius »

Holger wrote:Oh well, the smpeg/smpeg2 library always makes some headaches... :-/

Please try the following: Remove the "-lsmpeg2" from the file "src/Makefile"
Nope!
Removing the lsmpg2 reference from Makefile, returns:

Code: Select all

~/rocksndiamonds>make sdl2
make[1]: Entering directory `/home/giorgos/rocksndiamonds/src'
make[2]: Entering directory `/home/giorgos/rocksndiamonds/src/libgame'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/giorgos/rocksndiamonds/src/libgame'
make[2]: Entering directory `/home/giorgos/rocksndiamonds/src/game_em'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/giorgos/rocksndiamonds/src/game_em'
make[2]: Entering directory `/home/giorgos/rocksndiamonds/src/game_sp'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/giorgos/rocksndiamonds/src/game_sp'
gcc  main.o conf_gfx.o conf_snd.o conf_mus.o conf_hlp.o init.o config.o events.o tools.o screens.o game.o editor.o files.o tape.o cartoons.o network.o netserv.o  libgame/libgame.a game_em/game_em.a game_sp/game_sp.a -lSDL2_image -lSDL2_mixer -lSDL2_net -L/usr/lib/x86_64-linux-gnu -lSDL2  -lm -o ../rocksndiamonds
make[2]: Entering directory `/home/giorgos/rocksndiamonds/graphics'
make[3]: Entering directory `/home/giorgos/rocksndiamonds/graphics/gfx_classic'
ilbmtoppm RocksDC2.ilbm | pnmtopng > RocksDC2.png
/bin/sh: 1: /bin/sh: 1: pnmtopng: not foundilbmtoppm: not found

make[3]: *** [RocksDC2.png] Error 127
make[3]: Leaving directory `/home/giorgos/rocksndiamonds/graphics/gfx_classic'
make[2]: *** [gfx_classic_dir] Error 2
make[2]: Leaving directory `/home/giorgos/rocksndiamonds/graphics'
make[1]: *** [graphics_dir] Error 2
make[1]: Leaving directory `/home/giorgos/rocksndiamonds/src'
make: *** [sdl2] Error 2
~/rocksndiamonds>
Holger wrote:(or directly try it on the command line by copy'n'pasting the last command that caused the error, which also contains the "-lsmpeg2", and remove that part).
Didn't work either.
Giving:

Code: Select all

gcc  main.o conf_gfx.o conf_snd.o conf_mus.o conf_hlp.o init.o config.o events.o tools.o screens.o game.o editor.o files.o tape.o cartoons.o network.o netserv.o  libgame/libgame.a game_em/game_em.a game_sp/game_sp.a -lSDL2_image -lSDL2_mixer -lSDL2_net -L/usr/lib/x86_64-linux-gnu -lSDL2  -lm -o ../rocksndiamonds
returns:

Code: Select all

gcc: error: main.o: No such file or directory
gcc: error: conf_gfx.o: No such file or directory
gcc: error: conf_snd.o: No such file or directory
gcc: error: conf_mus.o: No such file or directory
gcc: error: conf_hlp.o: No such file or directory
gcc: error: init.o: No such file or directory
gcc: error: config.o: No such file or directory
gcc: error: events.o: No such file or directory
gcc: error: tools.o: No such file or directory
gcc: error: screens.o: No such file or directory
gcc: error: game.o: No such file or directory
gcc: error: editor.o: No such file or directory
gcc: error: files.o: No such file or directory
gcc: error: tape.o: No such file or directory
gcc: error: cartoons.o: No such file or directory
gcc: error: network.o: No such file or directory
gcc: error: netserv.o: No such file or directory
gcc: error: libgame/libgame.a: No such file or directory
gcc: error: game_em/game_em.a: No such file or directory
gcc: error: game_sp/game_sp.a: No such file or directory
~/rocksndiamonds>
Holger wrote:As far as I can see it, the library "SDL_mixer2" dynamically loads the library "smpeg2" at run-time, so it may be possible that your (apparently package based) installation of the smpeg2 library
Yes. They're from repositories from Ubuntu LTS (that Mint use).
Holger wrote:Maybe it's really time for a "configure" script now... :-/ )
I think yes!
You have to do the dirty work. :?
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Compilation question (Linux).

Post by Holger »

Hey, apparently removing "-lsmpeg2" *did* work! When looking at your console output, it passes the linking stage without error now (and then fails at the next step because it seems that it cannot find the programs "pnmtopng" and/or "ilbmtoppm" -- install the NetPBM package from your package manager (on Ubuntu, this package has the name "netpbm", I think), then it should work.)

Also have a look into your top level R'n'D directory -- it should contain a binary "rocksndiamonds" now.

(The cause for the second error apparently simply was that you executed it inside the top level directory, but have to execute it inside the "src" sub-directory. Sorry for not mentioning this detail.)
User avatar
Thalassius
Posts: 8
Joined: Mon Aug 17, 2015 2:09 pm

Re: Compilation question (Linux).

Post by Thalassius »

Holger wrote:Hey, apparently removing "-lsmpeg2" *did* work! When looking at your console output, it passes the linking stage without error now (and then fails at the next step because it seems that it cannot find the programs "pnmtopng" and/or "ilbmtoppm" -- install the NetPBM package from your package manager (on Ubuntu, this package has the name "netpbm", I think), then it should work.)
OK! :)
I installed netpbm and there is a pnmtopng file, but not a libmtoppm one.
Holger wrote:(The cause for the second error apparently simply was that you executed it inside the top level directory, but have to execute it inside the "src" sub-directory. Sorry for not mentioning this detail.)
OK! I changed to the src directory.
No compilation error messages, any more!
Holger wrote:Also have a look into your top level R'n'D directory -- it should contain a binary "rocksndiamonds" now.
Now there is the binary there, but:

Code: Select all

giorgos-Δευ 24/08/2015 05:27 μμ~/rocksndiamonds>./rocksndiamonds
rocksndiamonds: warning: configuration file '/home/giorgos/.rocksndiamonds/cache/artworkinfo.cache' is empty
rocksndiamonds: fatal error: LoadCustomImage(): cannot find file 'RocksFontSmall.png'
rocksndiamonds: aborting
giorgos-Δευ 24/08/2015 05:27 μμ~/rocksndiamonds>
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Compilation question (Linux).

Post by Holger »

> I installed netpbm and there is a pnmtopng file, but not a libmtoppm one.

Because it's "ilbmtoppm", not "libmtoppm". :-)

Did you get any further error messages when typing "make" (especially in the PNG file creation part)?

> rocksndiamonds: fatal error: LoadCustomImage(): cannot find file 'RocksFontSmall.png'

Do you have a file "graphics/gfx_classic/RocksFontSmall.png" relative to the directory from where you execute "./rocksndiamonds"?
User avatar
Thalassius
Posts: 8
Joined: Mon Aug 17, 2015 2:09 pm

Re: Compilation question (Linux).

Post by Thalassius »

Holger wrote:> I installed netpbm and there is a pnmtopng file, but not a libmtoppm one.

Because it's "ilbmtoppm", not "libmtoppm". :-)
Ooops! Sorry!!! :oops:
No ilbmtoppm either. :(
Holger wrote:Did you get any further error messages when typing "make" (especially in the PNG file creation part)?
No. I got no messages at all.
Holger wrote:> rocksndiamonds: fatal error: LoadCustomImage(): cannot find file 'RocksFontSmall.png'

Do you have a file "graphics/gfx_classic/RocksFontSmall.png" relative to the directory from where you execute "./rocksndiamonds"?
No. I can see only one PNG (RocksIcon32x32.png) and the respective ILBM files (eg. RocksFontSmall.ilbm).
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Compilation question (Linux).

Post by Holger »

> No ilbmtoppm either.

Very strange; "ilbmtoppm" is part of the "netpbm" package and required to build R'n'D from a Git checkout.

Maybe try to uninstall and install the "netpbm" package again?

> No. I got no messages at all.

Again, very strange -- as you apparently do not have any PNG file created yet, this should be done by the Makefile. Please "cd" into "graphics/gfx_classic" and do a "make clean ; make" (after you have a working "ilbmtoppm" installed).

> No. I can see only one PNG (RocksIcon32x32.png) and the respective ILBM files (eg. RocksFontSmall.ilbm).

Yes, the icon PNG file is part of the Git checkout (as it cannot be built from an ILBM file), while all other PNG files are created from their ILBM counterparts.
User avatar
Thalassius
Posts: 8
Joined: Mon Aug 17, 2015 2:09 pm

Re: Compilation question (Linux).

Post by Thalassius »

Holger wrote:> No ilbmtoppm either.

Very strange; "ilbmtoppm" is part of the "netpbm" package and required to build R'n'D from a Git checkout.

Maybe try to uninstall and install the "netpbm" package again?
Everything is OK now:

Code: Select all

giorgos-Τρι 25/08/2015 02:48 μμ~/rocksndiamonds>locate ilbmtoppm
/usr/bin/ilbmtoppm
/usr/share/man/man1/ilbmtoppm.1.gz
giorgos-Τρι 25/08/2015 02:50 μμ~/rocksndiamonds>
I don't know why it didn't work at the first place.
Anyway! Mint is based on Ubuntu LTS, which is based on Debian Testing.
Beta is a beta is a beta! :D
There will always be, some rough edges.
Stable is meant to be, only...the stable version (Debian).
Holger wrote:> No. I got no messages at all.

Again, very strange -- as you apparently do not have any PNG file created yet, this should be done by the Makefile. Please "cd" into "graphics/gfx_classic" and do a "make clean ; make" (after you have a working "ilbmtoppm" installed).

> No. I can see only one PNG (RocksIcon32x32.png) and the respective ILBM files (eg. RocksFontSmall.ilbm).

Yes, the icon PNG file is part of the Git checkout (as it cannot be built from an ILBM file), while all other PNG files are created from their ILBM counterparts.
Success!!! :D
Now every PNG file, is in place.
The executable seems to work properly now (although I'm getting some warnings):

Code: Select all

giorgos-Τρι 25/08/2015 02:48 μμ~/rocksndiamonds>./rocksndiamonds
rocksndiamonds: warning: configuration file '/home/giorgos/.rocksndiamonds/cache/artworkinfo.cache' is empty
rocksndiamonds: warning: cannot open configuration file '/home/giorgos/.rocksndiamonds/editorcascade.conf'
rocksndiamonds: warning: cannot open configuration file '/home/giorgos/.rocksndiamonds/editorsetup.conf'
giorgos-Τρι 25/08/2015 02:48 μμ~/rocksndiamonds>
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Compilation question (Linux).

Post by Holger »

Great to hear that it works now! :-)

The warnings are OK (because some default config files are not found, as they haven't been created yet); they should probably only be printed in some verbose or debug mode...
Post Reply