9

I am trying to install Marathon on my laptop. Been following along with the instructions at: https://github.com/Aleph-One-Marathon/alephone/wiki/Linux%20Install%20Instructions#ubuntu.

I installed the following libraries, per the instructions,

sudo apt-get install libboost-all-dev libsdl1.2-dev libsdl-image1.2-dev \
libsdl-net1.2-dev libsdl-ttf2.0-dev libspeexdsp-dev libzzip-dev \
libavcodec-dev libavformat-dev libavutil-dev libswscale-dev

However, when I configure the installation with,

 ~/file path/AlephOne$ ./ configure

I get the following message,

checking for SDL_ttf.h presence....no
error: You need SDL_ttf.h to run Aleph One.

I thought this was included in the libsdl-ttf2.0-dev? Anyone have any clues what is going on? Any help would be much appreciated.

andrew.46
  • 37,085
  • 25
  • 149
  • 228
Grant Moore
  • 105
  • 2
  • 2
  • 8
  • Is there a file `config.log` that shows more details of the error? Possibly configure is looking in the wrong location... – andrew.46 Jun 25 '16 at 19:38
  • Would it be in one of the logs in /var/log/ directory? I am looking look through the dpkg.log and it says, status unpacked lidsdl-ttf2.0-0:i386 2.0.11-3 Status half configured lodsdl-ttf2.0-0:i386 2.0.11-3 Status installed libsdl-ttf2.0-0:i386 2.0.11-3 Is that at all relevant? – Grant Moore Jun 25 '16 at 20:03
  • `config.log` will be generated in the same location as the `./configure` file and can be opened and searched with gedit or similar. Which version of Ubuntu are you running? I can run the compile in VM to check..... – andrew.46 Jun 25 '16 at 20:09
  • 16.04. Found the config.log. it's rather long. Is there anything in particular I should be looking for or should I paste the whole thing? – Grant Moore Jun 25 '16 at 20:36
  • You could narrow it down with `grep -C3 '\bSDL_ttf' config.log` – steeldriver Jun 25 '16 at 20:58
  • @GrantMoore configure ran perfectly on my VM, you must be missing the font? Run the following: `sudo find /usr -name SDL_ttf.h` and the result should be: `/usr/include/SDL/SDL_ttf.h` – andrew.46 Jun 25 '16 at 21:13
  • Another quick check might be to run `pkg-config --cflags SDL_ttf` – steeldriver Jun 25 '16 at 21:58
  • 1
    @andrew.46 I ran the find command. The file path says SDL2, not SDL, "usr/include/SDL2/SDL_ttf.h". – Grant Moore Jun 25 '16 at 23:26
  • 1
    After narrowing down the config.log with steeldriver's suggestion, I got the following result, "checking SDL_ttf.h usability / contest.c:64:21: fatal error: SDL_ttf.h: no such file or directory". – Grant Moore Jun 25 '16 at 23:32
  • Hmmm.... tempting to use a symlink there but you may be missing other files.... – andrew.46 Jun 26 '16 at 01:43
  • @GrantMoore Try the following instead of simply ./configure: `env CPPFLAGS='-I/usr/include/SDL2' ./configure` , I tested this on my own system after moving the sdl directory and seemed to work well enough. Perhaps this will be enough, if not we can dig a little deeper... – andrew.46 Jun 26 '16 at 10:33
  • @andrew.46 I tried your suggestion. It seems to be finding SDL_ttf.h now, but as you thought earlier, I think I may be missing more than just that one file. Here's the output when I run new configure, "checking for sdl-config... /usr/bin/sdl-config checking for SDL - version >= 1.2.0... yes checking SDL_ttf.h usability... yes checking SDL_ttf.h presence... yes checking for SDL_ttf.h... yes checking for TTF_Init in -lSDL_ttf... no configure: error: You need SDL_ttf to run Aleph One." – Grant Moore Jun 26 '16 at 12:27
  • I confess that I am out of ideas :(. But it compiles cleanly on my 16.04 system so it can be done. Try reinstalling the dependencies and if that fails I hope that somebody cleverer than me can help you out... – andrew.46 Jun 26 '16 at 18:02
  • @andrew.46 no worries, mate. I'm not too interested in actually playing Marathon as I am in learning how to use the command line (although everyone should play Marathon as it's a great game!). You've helped me out a ton! Cheers. – Grant Moore Jun 26 '16 at 18:57

2 Answers2

8

Try: sudo apt-get install libsdl2-ttf-dev

After that, you should find it via:

find /usr|grep SDL_ttf
Videonauth
  • 33,045
  • 16
  • 104
  • 120
John
  • 96
  • 1
  • 1
2

I was installing gosu gem for Ruby and had the same error, on Ubuntu 16.04. All solutions pointed to installing sdl2 ttf libs, but I already had them all installed. I noticed, however, that I had /usr/include/SDL2/SDL_ttf.h, and the gem included lib directories didn't list that one, but listed /usr/local/include/SDL2/SDL_ttf.h.

I managed to solve the problem by creating a symbolic link with

sudo ln -s /usr/include/SDL2/SDL_ttf.h /usr/local/include/SDL2/

  • I just experienced this on Ubuntu 18.04, and your solution worked for me. I'm surprised this issue has lasted as long as it has, but that's not all I found surprising. I supplied my own CFLAGS, as in `CFLAGS="$(pkg-config --cflags SDL2_ttf)" make`, and there was no change. The makefile hard-codes CFLAGS (not even `?=` or `+=` but `=`) based on the outcome of `configure`. In my case, this includes `-DHAVE_SDL_TTF`, which I do, but it omits the discovered path in favor of its own installation path, where of course it never installed SDL_ttf.h. Should be an easy fix, eh? – John P Aug 31 '18 at 20:06
  • In case anyone else has this issue, you can either add the path directly to CFLAGS in the Makefile, or you can replace the `=` with `+=` and prepend flags to your `make` invocation like I did. My apologies if what I'm talking about is unrelated to your issue, but I suspect that your local installation stepped on your system installation for the same reason. – John P Aug 31 '18 at 20:29