Installing SDL libraries

The place to post if you need help or advice

Moderators: ChrisThornett, LXF moderators

Installing SDL libraries

Postby SiriusHardware » Mon Aug 18, 2014 11:38 pm

After trying out Hatari (the Atari ST emulator) V1.5.0 from my distro's repositories I discovered that Hatari itself is now up to V1.8.0. Windows users get a pre-built binary but the Linux version is made available as source code to be compiled.

I've never attempted to compile from source before but I was sufficiently keen on this to give it a go.

However, I fail at the first step

'./configure'

...Because the process chugs along for a bit, then reports that I don't have the 'SDL libraries' installed. I'm struggling to find out how to go about finding and installing these libraries. I'm assuming (from limited experience with 'c' programming) that these libraries are 'C' source code which will be merged into Hatari as the program is compiled.

apt-cache search for SDL throws up dozens of packages which start with SDL - it's not immediately obvious which (if any) of these is the one I am looking for, or if the methodology for installing these libraries is different altogether.

Distro is Zorin OS 6 (Ubuntu derivative?).
SiriusHardware
 
Posts: 73
Joined: Tue Sep 25, 2012 6:41 pm

Postby lok1950 » Tue Aug 19, 2014 1:10 am

If you are compiling from source you will also need the -dev packages as well as these contain the C++ headers from what their webpage says it only needs the base SDL lib and it's dev version don't forget zlib and zlib-dev if you run in to more problems just post or PM me if you fell embarrassed :wink:

Enjoy the Choice :)
User avatar
lok1950
LXF regular
 
Posts: 1034
Joined: Tue May 31, 2005 5:31 am
Location: Ottawa

Postby SiriusHardware » Tue Aug 19, 2014 7:28 am

So does that mean I just have to apt-get install:

sdllib
sdllib-dev
zlib
zlib-dev

- and then try to compile again. It's as simple as that?
SiriusHardware
 
Posts: 73
Joined: Tue Sep 25, 2012 6:41 pm

Postby lok1950 » Tue Aug 19, 2014 1:47 pm

Yeah that what it looks like if you get any more errors in the configure stage post them here It will be usually just be an other missing -dev lib as they aren't installed by default in most distros.

Enjoy the Choice :)
User avatar
lok1950
LXF regular
 
Posts: 1034
Joined: Tue May 31, 2005 5:31 am
Location: Ottawa

Postby SiriusHardware » Tue Aug 19, 2014 8:01 pm

Not quite so simple so far - maybe I took you too literally, but my Distro has no package 'SDL'or 'SDL-dev' in its repositores. Focusing for the moment on SDL, I went to

http://www.libsdl.org/

Downloaded SDL-2.0.3.tar.gz, extracted the content of that archive to a folder, CDed into that folder and did ./confgure, then when that came to a halt with no apparent problems followed up with MAKE, which also appeared to go smoothly, followed by MAKE INSTALL which failed with a permissions issue until I tried SUDO MAKE INSTALL, which appeared to complete successfully. At this point, I assume rightly or wrongly that I have successfully installed some version of SDL-LIB

However, when I go back to the folder containing the files for Hatari 1.8.0 and go ./configure, it fails after a few lines with
Code: Select all
zorin@zorin-desktop:~/Downloads/hatari-1.8.0$ sudo ./configure
-- The C 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
-- Performing Test MUDFLAP_AVAILABLE
-- Performing Test MUDFLAP_AVAILABLE - Failed
-- Looking for include files CMAKE_HAVE_PTHREAD_H
-- Looking for include files CMAKE_HAVE_PTHREAD_H - found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
CMake Error at CMakeLists.txt:87 (message):
  SDL library not found!


This is the relevant section of CMakeLists.txt

Code: Select all
# ####################
# Check for libraries:
# ####################

find_package(SDL REQUIRED)
if(NOT SDL_FOUND)
   message(FATAL_ERROR "SDL library not found!")
endif(NOT SDL_FOUND)

find_package(Math)

find_package(Readline)
if(READLINE_FOUND)
   set(HAVE_LIBREADLINE 1)
endif(READLINE_FOUND)

find_package(ZLIB)
if(ZLIB_FOUND)
   set(HAVE_LIBZ 1)
   set(HAVE_ZLIB_H 1)
endif(ZLIB_FOUND)



What now?
SiriusHardware
 
Posts: 73
Joined: Tue Sep 25, 2012 6:41 pm

Postby lok1950 » Tue Aug 19, 2014 8:37 pm

It looks like it can not find the headers ie: the -dev part you may have to explicitly add it's path to the configure script.I am not sure but you may be able to add an other source(repo) that has sdl but it may not work as Zorin appears to be a stripped down version of Ubuntu,see if check-install is in your repo it installs complied apps like normal packages so they are easier to manage.

Enjoy the Choice :)
User avatar
lok1950
LXF regular
 
Posts: 1034
Joined: Tue May 31, 2005 5:31 am
Location: Ottawa

Postby SiriusHardware » Tue Aug 19, 2014 8:48 pm

Lok1950, thanks for continuing to help. I'll look into whether I have check-install available.

After digging a bit more I have found the following likely looking packages in Zorin OS 6's repositories

libsdl1.2debian
libsdl1.2-dev

If I attempt to install libsdl1.2debian I'm told it is already installed.

Code: Select all
libsdl1.2debian is already the latest version


If I attempt to install libsdl1.2-dev it fails with this output
Code: Select all
The following packages have unmet dependencies:
 libsdl1.2-dev : Depends libx11-dev but it is not going to be installed
E: unable to correct problems, you have held broken packages


Not to my knowledge, I haven't. If I try to install libx11-dev manually I get this:

Code: Select all
The following packages have unmet dependencies:
 libx11-dev : Depends: libx11-6 (=2:1.4.99.1-0ubuntu2.1) but 2:1.4.99.1-0ubuntu2.2 is to be installed
E: Unable to correct problems, you have held broken packages


and if I try to install libx11-6 I get this:

Code: Select all
libx11-6 is already the newest version


What's going on here? It seems highly likely to me that LIBX11-dev would coexist with the slightly newer 2.2 version of libx11-6 if it would only just give it a try. Is there a way / a switch to get it to bypass this objection, or to install despite the alleged absence of its preferred version of libx11-6?
SiriusHardware
 
Posts: 73
Joined: Tue Sep 25, 2012 6:41 pm

Postby lok1950 » Tue Aug 19, 2014 11:49 pm

Version mismatches can be fatal as the API for the lib may be what changed so the source code you have just may not compile the corruption may have been introduced with the compile/install of sdl from sdl.org.If you haven't done too much customization of your install of Zorin reinstalling it may be an option or getting it's latest which is 8 IIRC .

Enjoy the Choice :)
User avatar
lok1950
LXF regular
 
Posts: 1034
Joined: Tue May 31, 2005 5:31 am
Location: Ottawa

Postby SiriusHardware » Sat Aug 23, 2014 8:00 am

I was really keen to have this working so I took a deep breath and started to resolve the broken dependencies one by one.

The message

Code: Select all
 libx11-dev : Depends: libx11-6 (=2:1.4.99.1-0ubuntu2.1) but 2:1.4.99.1-0ubuntu2.2 is to be installed


Was somewhat misleading, because it appeared that 2.2 was already installed.

I didn't want to un-install libx11-6 2.2 because I was afraid that other software which depended on it would be removed if I did, so to fix that particular problem I did this:-

apt-get install libx11-6=2:1.4.99.1-0ubuntu2.1

-and that downgraded libx11-6 to the particular version that libx11-dev required. I kept going like that until all such broken dependencies were resolved and to my amazement the compiling process eventually made it all the way through, so when I next ran Hatari, it came up with the version number 1.8.0.

Quite pleased with myself, since what I know about Linux could still be written on the palm of my hand.
SiriusHardware
 
Posts: 73
Joined: Tue Sep 25, 2012 6:41 pm


Return to Help!

Who is online

Users browsing this forum: No registered users and 1 guest