Jump to content
  • Advertisement
Sign in to follow this  
Aerugo

Ubuntu error compiling SDL_stdinc.h

This topic is 3666 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

I recently learned SDL for cross-platform development. I learned SDL first on the Windows OS and now that I have some experience in SDL, I decided to try my luck in Linux (Ubuntu to be precise). The simple programs compiled good, even the ones with the extra libraries (image, ttf, mixer) compiled with little problems. I'm using the command-line compiler g++, and he has given me these error compiling my 'login'screen.
Quote:
/usr/include/SDL/SDL_types.h:38: error: conflicting declaration ‘SDL_FALSE’ /usr/local/include/SDL/SDL_stdinc.h:81: error: ‘SDL_FALSE’ has a previous declaration as ‘SDL_bool SDL_FALSE’ /usr/include/SDL/SDL_types.h:39: error: conflicting declaration ‘SDL_TRUE’ /usr/local/include/SDL/SDL_stdinc.h:82: error: ‘SDL_TRUE’ has a previous declaration as ‘SDL_bool SDL_TRUE’ /usr/include/SDL/SDL_types.h:40: error: conflicting declaration ‘typedef enum SDL_bool SDL_bool’ /usr/local/include/SDL/SDL_stdinc.h:83: error: ‘SDL_bool’ has a previous declaration as ‘typedef enum SDL_bool SDL_bool’ /usr/include/SDL/SDL_types.h:110: error: conflicting declaration ‘DUMMY_ENUM_VALUE’ /usr/local/include/SDL/SDL_stdinc.h:129: error: ‘DUMMY_ENUM_VALUE’ has a previous declaration as ‘SDL_DUMMY_ENUM DUMMY_ENUM_VALUE’ /usr/include/SDL/SDL_types.h:111: error: conflicting declaration ‘typedef enum SDL_DUMMY_ENUM SDL_DUMMY_ENUM’ /usr/local/include/SDL/SDL_stdinc.h:130: error: ‘SDL_DUMMY_ENUM’ has a previous declaration as ‘typedef enum SDL_DUMMY_ENUM SDL_DUMMY_ENUM’ /usr/include/SDL/SDL_types.h:118: error: expected identifier before numeric constant /usr/include/SDL/SDL_types.h:118: error: expected `}' before numeric constant /usr/include/SDL/SDL_types.h:118: error: expected unqualified-id before numeric constant /usr/include/SDL/SDL_types.h:118: error: expected declaration before ‘}’ token
As it would seem, there are some problems with SDL_stdinc.h, But I have no idea of how to solve this. Thank you in advance. Aerugo

Share this post


Link to post
Share on other sites
Advertisement
Perhaps you need to upgrade your SDL. Here is my version of SDL_types.h (complete minus the copyright):

/* DEPRECATED */
#include "SDL_stdinc.h"


How did you install SDL? With apt-get?

Share this post


Link to post
Share on other sites
It looks like your SDL headers are in two distinct locations (/usr/include and /usr/local/include). Why? Are you certain that the same version of SDL is present at both locations? I suspect a weird interaction between include directory priority and differing header versions.

Share this post


Link to post
Share on other sites
SDL version is 1.2, the latest stable one I presumed? But I installed it using Ubuntu's synaptic packet manager.

And ToohrVyk, you might be right, but do you know how I could solve this? Removing one path from the PATH variable maybe?

Share this post


Link to post
Share on other sites
I would personally:

sudo mv /usr/include/SDL /usr/include/SDL.bak
sudo ln -s /usr/local/include/SDL /usr/include/SDL


That is, make the /usr/include path be a symlink to the /usr/local/include path. This would avoid all the issues related to finding all the locations where input paths are specified (since it can be done on the command line for g++ using -I regardless of what environment variables you export).

Share this post


Link to post
Share on other sites
Great! It works! I did have to install SDL_image, SDL_ttf and SDL_mixer again, but that's easy using the synaptic packet manager. Th code compiled perfectly. Thank you.

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!