SDL 1.2.(14?) on Linux

Started by
7 comments, last by Bregma 12 years ago
First time trying to initialize SDL on a linux system (Mint 12)...

Got the libraries installed and the headers included, but I am getting this error (the code was working on 1.2.13 last I can recall...)

$ scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
g++ -o debug/program.o -c -Wall -DDEBUG -lSDL src/program.cc
src/program.cc: In member function 'int Program::startSdl()':
src/program.cc:57:25: error: 'SDL_GL_CONTEXT_MAJOR_VERSION' was not declared in this scope
src/program.cc:58:22: error: 'SDL_GL_CONTEXT_MINOR_VERSION' was not declared in this scope
src/program.cc:64:30: error: 'SDL_WINDOWPOS_CENTERED' was not declared in this scope
src/program.cc:66:9: error: 'SDL_WINDOW_OPENGL' was not declared in this scope
src/program.cc:66:29: error: 'SDL_WINDOW_SHOWN' was not declared in this scope
src/program.cc:66:48: error: 'SDL_WINDOW_FULLSCREEN' was not declared in this scope
src/program.cc:67:5: error: 'SDL_CreateWindow' was not declared in this scope
src/program.cc:78:77: error: 'SDL_GL_CreateContext' was not declared in this scope
src/program.cc:81:26: error: 'SDL_GL_SetSwapInterval' was not declared in this scope
scons: *** [debug/program.o] Error 1
scons: building terminated because of errors.


Looking at my SDL_version.h file, it looks like the version I have is 1.2.14.

Are these missing from that version of SDL? Not sure why I am getting these errors.
Advertisement
Maybe this code was originally SDL 1.3...but now I can't find anything on SDL 1.3, is it now SDL 2.0 only?

I don't know how to upgrade on a linux system, those versions don't appear with aptitude search.

Do I just download the source code and copy over the include and lib directories?
The switch from 1.3 to 2.0 surprise me too, but if an application is built for 1.2 it won't work on the other one since it changed quite a bit. Just a quick question, do you actually include sdl.h somewhere in your program.cc file (or any included file)? Look to me you just need to include the header.

edit: Sorry, I searched SDL_GL_CONTEXT_MAJOR_VERSION and it don't exist in 1.2. Bad information. You are probably on the right track to download and build 2.0 yourself since I doubt any linux repository have it yet.
Okay I only had git installed so I installed mercurial, and autoconf (not a lot of experience building from the command line).
According to the install guide I ran ./autogen.sh which set me up to run ./configure, supposedly.

When I run ./configure, however, it does some stuff and ends off with this error:
configure: error:
*** When building from Mercurial you should configure and build in a
separate directory so you don't clobber SDL_config.h, SDL_revision.h


What does this mean, exactly. How can I run ./configure if I'm not in the SDL directory?

What does this mean, exactly. How can I run ./configure if I'm not in the SDL directory?

That usually means something along the lines of:
mkdir sdl-build
cd sdl-build
../configure

I'm not sure though if it can be a sub-directory of the root SDL folder..
Yes that was it. Thanks!
You could consider grabbing the officially maintained Debian package from the Debian archives. Mint is just a rebranded Ubuntu, which is a tweaked Debian, so there's a good chance it would work if you download and install the binary deb from there. Alternatively, you can download the source package and build using dpkg, so you can use aptitude to continue to install, replace, or remove the library as new officially supported releases come out.

Stephen M. Webb
Professional Free Software Developer

Well I did use 'sudo aptitude install libsdl1.2-dev' to install it. I'm now running SDL 2.0, trying to work out the openGL context. I'm getting a 2.1 context when I requested 3.3
I suggested getting the SDL-1.3 debs from Debian. That's not at all the same thing as the Ubuntu version of SDL-1.2 that Mint provides. Try the SDL-1.3 package from the link I provided. You can download the .deb from there and use 'sudo dpkg -i' to install it.

Stephen M. Webb
Professional Free Software Developer

This topic is closed to new replies.

Advertisement