Please support VectorLinux!

Author Topic: Compiling a game with SDL libraries  (Read 2274 times)

Villain

  • Member
  • *
  • Posts: 2
Compiling a game with SDL libraries
« on: September 20, 2011, 10:41:17 am »
I'm attempting to install a game that uses SDL.  I've installed the latest stable release of SDL (SDL-1.2.14) and SDL_gfx-2.0.22 from source.  During game compilation, I receive this error:

Code: [Select]
g++ -DHAVE_CONFIG_H -I. -I..   -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT  -I/usr/include/libxml2   -I./guichan/include -DPKG_DATADIR=\""/usr/local/share/manaplus/"\" -DLOCALEDIR=\""/usr/local/share/locale"\" -Wall   -DUSE_INTERNALGUICHAN   -MT gui/widgets/manaplus-avatarlistbox.o -MD -MP -MF gui/widgets/.deps/manaplus-avatarlistbox.Tpo -c -o gui/widgets/manaplus-avatarlistbox.o `test -f 'gui/widgets/avatarlistbox.cpp' || echo './'`gui/widgets/avatarlistbox.cpp
In file included from ./localplayer.h:28:0,
                 from gui/widgets/avatarlistbox.cpp:28:
./client.h:33:27: fatal error: SDL_framerate.h: No such file or directory
compilation terminated.
make[2]: *** [gui/widgets/manaplus-avatarlistbox.o] Error 1
make[2]: Leaving directory `/home/adam/manaplus/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/adam/manaplus'
make: *** [all] Error 2

SDL_framerate.h is a part of the SDL_gfx library.  The game is searching /usr/include/SDL for the appropriate include files, however, the SDL libraries that I've installed from source have been installed in /usr/local/lib by their respective packages. 

I see two solutions to this but don't know how to do so.  I install the libraries in the directory the game is searching for the files or I have the game search a different directory for the SDL files instead of its default.  I think it would be easier to have the game search for /usr/local/lib where my SDL libraries are located during compilation and I've tried "make -I/usr/local/lib" but still receive the same error.  What should I do to fix this problem?


pierce.jason

  • Packager
  • Vectorite
  • ****
  • Posts: 250
Re: Compiling a game with SDL libraries
« Reply #1 on: September 20, 2011, 10:49:00 am »
Do you have a configure executable in the source directory? `./configure --includedir=/usr/local/lib` would probably do the trick.
pierce.jason
Email: $(echo -e "moc\x2eliamg\x40nosaj.ecreip" | rev)

hata_ph

  • Packager
  • Vectorian
  • ****
  • Posts: 3261
  • -- Just being myself --
Re: Compiling a game with SDL libraries
« Reply #2 on: September 20, 2011, 08:00:37 pm »
have u try run below in terminal?

Quote
locate SDL_framerate.h

Villain

  • Member
  • *
  • Posts: 2
Re: Compiling a game with SDL libraries
« Reply #3 on: September 22, 2011, 08:01:56 am »
Thanks for the replies.

I made copies of the SDL library files from /usr/local/lib to /usr/include/SDL.  I know that isn't the best approach but it allowed me to compile. 

I was looking for the "correct" way to solve my problem so I will give your includedir suggestion a try pierce.jason.