1General Posted July 6, 2021 Share Posted July 6, 2021 Dear 0ad developers, When I try to compile the source code from svn, I found a bug with errors like fatal error SDL.h: No such file or directory Here I notice that in ubuntu the libsdl2 called like this #include <SDL2/SDL.h> and libsdl1 #include <sdl/SDL.h> To fix this error there is two simple ways the first one is to replace #include <SDL.h> with #include <SDL2/SDL.h> and every libsdl2 header need to add SDL2/header_name.h The other way which I tried here, is to add -D_REENTRANT -I/usr/include/SDL2 -lSDL2 to makefile ALL_CFLAGS += ... -D_REENTRANT -I/usr/include/SDL2 -lSDL2 ALL_CXXFLAGS += .... -D_REENTRANT -I/usr/include/SDL2 -lSDL2 And thanks for your time and this honorable work. Link to comment Share on other sites More sharing options...
vladislavbelov Posted July 6, 2021 Share Posted July 6, 2021 Hi! Have you installed libsdl2-dev? And what's a value of an SDL2_CONFIG env? Link to comment Share on other sites More sharing options...
1General Posted July 6, 2021 Author Share Posted July 6, 2021 (edited) I install libsdl2-dev then how I fix the bug ! sdl2-config --cflags --libs give -I/usr/include/SDL2 -D_REENTRANT -lSDL2 ----------------------------- pkg-config --cflags --libs sdl2 give -D_REENTRANT -I/usr/include/SDL2 -lSDL2 Edited July 6, 2021 by 1General Link to comment Share on other sites More sharing options...
Yekaterina Posted July 6, 2021 Share Posted July 6, 2021 6 minutes ago, 1General said: I install libsdl2-dev then how I fix the bug ! sdl2-config --cflags --libs give -I/usr/include/SDL2 -D_REENTRANT -lSDL2 ----------------------------- pkg-config --cflags --libs sdl2 give -D_REENTRANT -I/usr/include/SDL2 -lSDL2 Edited 1 minute ago by 1General is this 20.04 or 21.04? Link to comment Share on other sites More sharing options...
1General Posted July 6, 2021 Author Share Posted July 6, 2021 cat /etc/*release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=20.04 DISTRIB_CODENAME=focal DISTRIB_DESCRIPTION="Ubuntu 20.04.2 LTS" NAME="Ubuntu" VERSION="20.04.2 LTS (Focal Fossa)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 20.04.2 LTS" VERSION_ID="20.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=focal UBUNTU_CODENAME=focal Link to comment Share on other sites More sharing options...
1General Posted July 6, 2021 Author Share Posted July 6, 2021 I can try it with docker It will be the same bug. Link to comment Share on other sites More sharing options...
vladislavbelov Posted July 6, 2021 Share Posted July 6, 2021 35 minutes ago, 1General said: sdl2-config --cflags --libs give -I/usr/include/SDL2 -D_REENTRANT -lSDL2 ----------------------------- pkg-config --cflags --libs sdl2 give -D_REENTRANT -I/usr/include/SDL2 -lSDL2 So these path are correct, and no need to change something in the code. Maybe there is a problem somewhere in premake which doesn't catch these paths properly. Link to comment Share on other sites More sharing options...
asterix Posted July 6, 2021 Share Posted July 6, 2021 26 minutes ago, 1General said: I can try it with docker It will be the same bug. Just a thought, have you compiled it against sdl 2.12 and not the current one, because of this https://trac.wildfiregames.com/changeset/25389 Link to comment Share on other sites More sharing options...
asterix Posted July 6, 2021 Share Posted July 6, 2021 @fabio any help here, please? Link to comment Share on other sites More sharing options...
1General Posted July 15, 2021 Author Share Posted July 15, 2021 Closed case, It work fine in latest svn. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now