Jump to content
  • Advertisement
Sign in to follow this  
PrestoChung

SDL 1.2.(14?) on Linux

This topic is 2287 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

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..

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!