1General Posted July 6, 2021 Report 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. Quote Link to comment Share on other sites More sharing options...
vladislavbelov Posted July 6, 2021 Report Share Posted July 6, 2021 Hi! Have you installed libsdl2-dev? And what's a value of an SDL2_CONFIG env? Quote Link to comment Share on other sites More sharing options...
1General Posted July 6, 2021 Author Report 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 Quote Link to comment Share on other sites More sharing options...
Yekaterina Posted July 6, 2021 Report 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? Quote Link to comment Share on other sites More sharing options...
1General Posted July 6, 2021 Author Report 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 Quote Link to comment Share on other sites More sharing options...
1General Posted July 6, 2021 Author Report Share Posted July 6, 2021 I can try it with docker It will be the same bug. Quote Link to comment Share on other sites More sharing options...
vladislavbelov Posted July 6, 2021 Report 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. Quote Link to comment Share on other sites More sharing options...
asterix Posted July 6, 2021 Report 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 Quote Link to comment Share on other sites More sharing options...
asterix Posted July 6, 2021 Report Share Posted July 6, 2021 @fabio any help here, please? Quote Link to comment Share on other sites More sharing options...
seeh Posted July 6, 2021 Report Share Posted July 6, 2021 (edited) 1 hour ago, asterix said: @fabio any help here, please? https://youtu.be/kOQPiud3fks thats (k)ubuntu. so it may help you. may importend: fromhttps://trac.wildfiregames.com/wiki/BuildInstructions#Dependencies On Debian 10 (Buster) or Ubuntu 18.04 LTS (Bionic Beaver) or later install the required dependencies with: sudo apt-get install -y build-essential cmake libboost-dev libboost-system-dev \ libboost-filesystem-dev libcurl4-gnutls-dev libenet-dev libfmt-dev \ libgloox-dev libicu-dev libminiupnpc-dev libnvtt-dev libogg-dev \ libopenal-dev libpng-dev libsdl2-dev libsodium-dev libvorbis-dev \ libxml2-dev python rustc subversion zlib1g-dev If you want to use a packaged SpiderMonkey, which will be made available for example in 0ad.dev PPA: you should add libmozjs-78-dev and run update-workspace.sh with --with-system-mozjs. When not using system nvidia-texture-tools, libnvtt-dev can be omitted, but cmake is needed to build the bundled NVTT. You can also use libcurl4-openssl-dev instead of libcurl4-gnutls-dev (it's not possible to install both at once), but note that openssl is not GPL compatible and the resulting binaries could not be redistributed. Finally you need to install the WX libraries for Atlas: sudo apt install -y wx3.0-headers libwxbase3.0-dev libwxgtk3.0-gtk3-dev libwxbase3.0-0v5 Edited July 6, 2021 by seeh Quote Link to comment Share on other sites More sharing options...
1General Posted July 15, 2021 Author Report Share Posted July 15, 2021 Closed case, It work fine in latest svn. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.