Src/sdl_wrappers.h:13:13: fatal error: 'SDL.h' file not found

I’m trying to compile a game called Cataclysm: Dark Days Ahead and I’m getting this error:

In file included from src/cata_tiles.cpp:2:
In file included from src/cata_tiles.h:25:
src/sdl_wrappers.h:13:13: fatal error: 'SDL.h' file not found
#   include <SDL.h>
            ^~~~~~~
1 error generated.
make: *** [Makefile:995: obj/tiles/cata_tiles.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from src/animation.cpp:29:
In file included from src/cata_tiles.h:25:
src/sdl_wrappers.h:13:13: fatal error: 'SDL.h' file not found
#   include <SDL.h>
            ^~~~~~~
1 error generated.

I asked for help in the game forum and I was told:

SDL.h should be in /usr/include/SDL2/SDL.h installed by sdl2 package (check that).
Check that your “gcc -v -E -” lists /usr/include. Other than that, no idea.

The SDL.h file is in the /usr/include/SDL2/ folder
and

/usr/include

does show up in the results after running “gcc -v -E -”
Link to the game forum thread.

These are the sdl related apps installed:

lib32-sdl_ttf [Installed] 2.0.11-8 multilib
A library that allows you to use TrueType fonts in your SDL applications (32-bit)
lib32-sdl_mixer [Installed] 1.2.12-5 multilib
A simple multi-channel audio mixer
lib32-sdl_image [Installed] 1.2.12-8 multilib
A simple library to load images of various formats as SDL surfaces (32-bit)
lib32-sdl2_ttf [Installed] 2.20.2-1 multilib
Library that allows you to use TrueType fonts in your SDL applications (Version 2) (32-bit)
lib32-sdl2_mixer [Installed] 2.6.3-1 multilib
A simple multi-channel audio mixer
lib32-sdl2_image [Installed] 2.6.3-1 multilib
A simple library to load images of various formats as SDL surfaces
lib32-sdl2 [Installed] 2.26.5-1 multilib
A library for portable low-level access to a video framebuffer, audio output, mouse, and keyboard
lib32-sdl12-compat [Installed] 1.2.60-1 multilib
SDL 1.2 runtime compatibility library using SDL 2.0
sdl_ttf [Installed] 2.0.11-6 community
A library that allows you to use TrueType fonts in your SDL applications
sdl_mixer [Installed] 1.2.12-12 community
A simple multi-channel audio mixer
sdl_image [Installed] 1.2.12-8 community
A simple library to load images of various formats as SDL surfaces
sdl2_ttf [Installed] 2.20.2-1 extra
A library that allows you to use TrueType fonts in your SDL applications (Version 2)
sdl2_mixer [Installed] 2.6.3-1 extra
A simple multi-channel audio mixer (Version 2)
sdl2_image [Installed] 2.6.3-1 extra
A simple library to load images of various formats as SDL surfaces (Version 2)
sdl2 [Installed] 2.26.5-1 extra
A library for portable low-level access to a video framebuffer, audio output, mouse, and
keyboard (Version 2)
sdl12-compat [Installed] 1.2.60-1 community
SDL 1.2 runtime compatibility library using SDL 2.0
sdl-openglhq-nokbgrab

Moderator edit: In the future, please use proper formatting: [HowTo] Post command output and file content as formatted text

$ pamac search --files SDL.h | grep /usr/include
/usr/include/SDL/SDL.h is owned by sdl12-compat
/usr/include/SDL2/SDL.h is owned by sdl2
pamac install sdl2 sdl12-compat

Running

pamac search --files SDL.h | grep /usr/include

gives me the same results.

Running

pamac install sdl2 sdl12-compat

outputs

$ pamac install sdl2 sdl12-compat
Preparing...
Warning: sdl12-compat-1.2.60-1 is up to date -- skipping
Warning: sdl2-2.26.5-1 is up to date -- skipping
Nothing to do.
Transaction successfully finished.

Try modifying it to # include <SDL/SDL.h> or # include <SDL2/SDL.h> what ever version it needs. When using <> it will search in /usr/include, when using "" it needs an absolute/relative path.

I modified /usr/include/SDL2/SDL.h and added:

#include <SDL/SDL.h>
#include <SDL2/SDL.h>
#include "SDL/SDL.h"
#include "SDL2/SDL.h"
# include <SDL/SDL.h>
# include <SDL2/SDL.h>
# include "SDL/SDL.h"
# include "SDL2/SDL.h"

This is the whole file:

/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL.h
 *
 *  Main include header for the SDL library
 */


#ifndef SDL_h_
#define SDL_h_

#include <SDL/SDL.h>
#include <SDL2/SDL.h>
#include "SDL/SDL.h"
#include "SDL2/SDL.h"
# include <SDL/SDL.h>
# include <SDL2/SDL.h>
# include "SDL/SDL.h"
# include "SDL2/SDL.h"
#include "SDL_main.h"
#include "SDL_stdinc.h"
#include "SDL_assert.h"
#include "SDL_atomic.h"
#include "SDL_audio.h"
#include "SDL_clipboard.h"
#include "SDL_cpuinfo.h"
#include "SDL_endian.h"
#include "SDL_error.h"
#include "SDL_events.h"
#include "SDL_filesystem.h"
#include "SDL_gamecontroller.h"
#include "SDL_guid.h"
#include "SDL_haptic.h"
#include "SDL_hidapi.h"
#include "SDL_hints.h"
#include "SDL_joystick.h"
#include "SDL_loadso.h"
#include "SDL_log.h"
#include "SDL_messagebox.h"
#include "SDL_metal.h"
#include "SDL_mutex.h"
#include "SDL_power.h"
#include "SDL_render.h"
#include "SDL_rwops.h"
#include "SDL_sensor.h"
#include "SDL_shape.h"
#include "SDL_system.h"
#include "SDL_thread.h"
#include "SDL_timer.h"
#include "SDL_version.h"
#include "SDL_video.h"
#include "SDL_locale.h"
#include "SDL_misc.h"

#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif

/* As of version 0.5, SDL is loaded dynamically into the application */

/**
 *  \name SDL_INIT_*
 *
 *  These are the flags which may be passed to SDL_Init().  You should
 *  specify the subsystems which you will be using in your application.
 */
/* @{ */
#define SDL_INIT_TIMER          0x00000001u
#define SDL_INIT_AUDIO          0x00000010u
#define SDL_INIT_VIDEO          0x00000020u  /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */
#define SDL_INIT_JOYSTICK       0x00000200u  /**< SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS */
#define SDL_INIT_HAPTIC         0x00001000u
#define SDL_INIT_GAMECONTROLLER 0x00002000u  /**< SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK */
#define SDL_INIT_EVENTS         0x00004000u
#define SDL_INIT_SENSOR         0x00008000u
#define SDL_INIT_NOPARACHUTE    0x00100000u  /**< compatibility; this flag is ignored. */
#define SDL_INIT_EVERYTHING ( \
                SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \
                SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER | SDL_INIT_SENSOR \
            )
/* @} */

/**
 * Initialize the SDL library.
 *
 * SDL_Init() simply forwards to calling SDL_InitSubSystem(). Therefore, the
 * two may be used interchangeably. Though for readability of your code
 * SDL_InitSubSystem() might be preferred.
 *
 * The file I/O (for example: SDL_RWFromFile) and threading (SDL_CreateThread)
 * subsystems are initialized by default. Message boxes
 * (SDL_ShowSimpleMessageBox) also attempt to work without initializing the
 * video subsystem, in hopes of being useful in showing an error dialog when
 * SDL_Init fails. You must specifically initialize other subsystems if you
 * use them in your application.
 *
 * Logging (such as SDL_Log) works without initialization, too.
 *
 * `flags` may be any of the following OR'd together:
 *
 * - `SDL_INIT_TIMER`: timer subsystem
 * - `SDL_INIT_AUDIO`: audio subsystem
 * - `SDL_INIT_VIDEO`: video subsystem; automatically initializes the events
 *   subsystem
 * - `SDL_INIT_JOYSTICK`: joystick subsystem; automatically initializes the
 *   events subsystem
 * - `SDL_INIT_HAPTIC`: haptic (force feedback) subsystem
 * - `SDL_INIT_GAMECONTROLLER`: controller subsystem; automatically
 *   initializes the joystick subsystem
 * - `SDL_INIT_EVENTS`: events subsystem
 * - `SDL_INIT_EVERYTHING`: all of the above subsystems
 * - `SDL_INIT_NOPARACHUTE`: compatibility; this flag is ignored
 *
 * Subsystem initialization is ref-counted, you must call SDL_QuitSubSystem()
 * for each SDL_InitSubSystem() to correctly shutdown a subsystem manually (or
 * call SDL_Quit() to force shutdown). If a subsystem is already loaded then
 * this call will increase the ref-count and return.
 *
 * \param flags subsystem initialization flags
 * \returns 0 on success or a negative error code on failure; call
 *          SDL_GetError() for more information.
 *
 * \since This function is available since SDL 2.0.0.
 *
 * \sa SDL_InitSubSystem
 * \sa SDL_Quit
 * \sa SDL_SetMainReady
 * \sa SDL_WasInit
 */
extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags);

/**
 * Compatibility function to initialize the SDL library.
 *
 * In SDL2, this function and SDL_Init() are interchangeable.
 *
 * \param flags any of the flags used by SDL_Init(); see SDL_Init for details.
 * \returns 0 on success or a negative error code on failure; call
 *          SDL_GetError() for more information.
 *
 * \since This function is available since SDL 2.0.0.
 *
 * \sa SDL_Init
 * \sa SDL_Quit
 * \sa SDL_QuitSubSystem
 */
extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags);

/**
 * Shut down specific SDL subsystems.
 *
 * If you start a subsystem using a call to that subsystem's init function
 * (for example SDL_VideoInit()) instead of SDL_Init() or SDL_InitSubSystem(),
 * SDL_QuitSubSystem() and SDL_WasInit() will not work. You will need to use
 * that subsystem's quit function (SDL_VideoQuit()) directly instead. But
 * generally, you should not be using those functions directly anyhow; use
 * SDL_Init() instead.
 *
 * You still need to call SDL_Quit() even if you close all open subsystems
 * with SDL_QuitSubSystem().
 *
 * \param flags any of the flags used by SDL_Init(); see SDL_Init for details.
 *
 * \since This function is available since SDL 2.0.0.
 *
 * \sa SDL_InitSubSystem
 * \sa SDL_Quit
 */
extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags);

/**
 * Get a mask of the specified subsystems which are currently initialized.
 *
 * \param flags any of the flags used by SDL_Init(); see SDL_Init for details.
 * \returns a mask of all initialized subsystems if `flags` is 0, otherwise it
 *          returns the initialization status of the specified subsystems.
 *
 *          The return value does not include SDL_INIT_NOPARACHUTE.
 *
 * \since This function is available since SDL 2.0.0.
 *
 * \sa SDL_Init
 * \sa SDL_InitSubSystem
 */
extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags);

/**
 * Clean up all initialized subsystems.
 *
 * You should call this function even if you have already shutdown each
 * initialized subsystem with SDL_QuitSubSystem(). It is safe to call this
 * function even in the case of errors in initialization.
 *
 * If you start a subsystem using a call to that subsystem's init function
 * (for example SDL_VideoInit()) instead of SDL_Init() or SDL_InitSubSystem(),
 * then you must use that subsystem's quit function (SDL_VideoQuit()) to shut
 * it down before calling SDL_Quit(). But generally, you should not be using
 * those functions directly anyhow; use SDL_Init() instead.
 *
 * You can use this function with atexit() to ensure that it is run when your
 * application is shutdown, but it is not wise to do this from a library or
 * other dynamically loaded code.
 *
 * \since This function is available since SDL 2.0.0.
 *
 * \sa SDL_Init
 * \sa SDL_QuitSubSystem
 */
extern DECLSPEC void SDLCALL SDL_Quit(void);

/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"

#endif /* SDL_h_ */

/* vi: set ts=4 sw=4 expandtab: */

I’m still getting the error:

_wrappers.h:13:13: fatal error: 'SDL.h' file not found
#   include <SDL.h>
            ^~~~~~~
1 error generated.

No idea. There must be a problem at configure script and sort of. I will try it myself later and update my post.

Update: I run it like this.

$ make -j$(nproc) PREFIX=$PWD/install CLANG=0 CCACHE=1 NATIVE=linux64 RELEASE=1 TILES=1
CCACHE_SLOPPINESS=pch_defines,time_macros,include_file_ctime,include_file_mtime ccache g++ -Os -Wodr -Werror -Wall -Wextra -Wformat-signedness -Wlogical-op -Wmissing-declarations -Wmissing-noreturn -Wnon-virtual-dtor -Wold-style-cast -Woverloaded-virtual -Wpedantic -Wsuggest-override -Wunused-macros -Wzero-as-null-pointer-constant -Wno-unknown-warning-option -Wno-dangling-reference -Wno-c++20-compat -Wredundant-decls -fsigned-char -std=c++17 -m64 -I/usr/include/SDL2 -I/usr/include/libpng16 -DHWY_SHARED_DEFINE -I/usr/include/webp -D_REENTRANT -MMD -MP -DCATA_IN_TOOL -Itools/format -Isrc -isystem src/third-party \
  tools/format/format.cpp tools/format/format_main.cpp src/json.cpp -o tools/format/json_formatter.cgi
Cannot run an astyle check, your system either does not have astyle, or it is too old.
grep: src/PREFIX.h: Datei oder Verzeichnis nicht gefunden
// NOLINT(cata-header-guard)
#define PREFIX "/storage/Projekte/github.com/Cataclysm-DDA/install"
CCACHE_SLOPPINESS=pch_defines,time_macros,include_file_ctime,include_file_mtime ccache g++ -Isrc -isystem src/third-party -DRELEASE -DGIT_VERSION -DTILES -DBACKTRACE -DLOCALIZE -DPREFIX="/storage/Projekte/github.com/Cataclysm-DDA/install" -DDATA_DIR_PREFIX -Os -Wodr -Werror -Wall -Wextra -Wformat-signedness -Wlogical-op -Wmissing-declarations -Wmissing-noreturn -Wnon-virtual-dtor -Wold-style-cast -Woverloaded-virtual -Wpedantic -Wsuggest-override -Wunused-macros -Wzero-as-null-pointer-constant -Wno-unknown-warning-option -Wno-dangling-reference -Wno-c++20-compat -Wredundant-decls -fsigned-char -std=c++17 -m64 -I/usr/include/SDL2 -I/usr/include/libpng16 -DHWY_SHARED_DEFINE -I/usr/include/webp -D_REENTRANT -MMD -MP -Wno-error -c pch/main-pch.hpp -o pch/main-pch.hpp.gch

And as I see, it found it, see -I/usr/include/SDL2. Still compiling anyway.

Update2: Compilation successful. No errors.

I ran these commands when my system drive was running out of space:

find ~/.cache/ -type f -atime +100 -delete
journalctl --vacuum-size=50M
journalctl --vacuum-time=2weeks

from System Maintenance - Manjaro

pamac remove -o
pamac clean

from Pamac - Manjaro

I think I ran most of these commands:

sudo pacman -Sc
sudo pacman -Qdt
sudo pacman -Rns $(pacman -Qtdq)
#Remove orphaned libraries
pamac remove --orphans
#clean cache
pamac clean --build-files
# Clean kioexec cache
rm --recursive ~/.cache/kioexec/krun/*
# Vacuum journals
sudo journalctl --vacuum-size=500M && sudo journalctl --vacuum-time=7d

# Remove all uninstalled packages
sudo paccache -rvuk0

# Remove old installed packages, leave 3
sudo paccache -rvk3

# Clean yay cache
yay -Sc -a

# Clean pamac build cache
pamac clean -bv

# Clean temporary build files
rm -rf ~/{.bundle,.cargo,.cmake,.dotnet,.electron,.electron-gyp,.gem,.gradle,.lazarus,.node-gyp,.npm,.nuget,.nvm,.racket,.rustup,.stack,.yarn} || true
rm -rf ~/.cache/{electron,electron-builder,go-build,node-gyp,pip,yarn} || true
sudo rm -rf ~/go || true

# Find files not owned by any package
sudo lostfiles

from Cleaning up and freeing disk space - #31 by Yochanan

Could any of these commands have caused the problem?

Nope, none of them could result in your error. Try to compile it without ccache or purge the ccache?

I tried compiling the game after purging the ccache and also after compiling without ccache. I still got the same error.

I’m not sure what I should include from the compile command you used.

These are the scripts I usually use to install or update the game:

Install:

#!/bin/bash

repo=("/home/satjwu/Cataclysm-DDA")

git clone --depth 1 https://github.com/CleverRaven/Cataclysm-DDA.git
cd "${repo}"
make -j12 CLANG=1 CCACHE=1 RELEASE=1 TILES=1 SOUND=1 LUA=1 USE_XDG_DIR=1
./cataclysm-tiles

Update:

#!/bin/bash

repo=("/home/satjwu/Cataclysm-DDA")

cd "${repo}"
git pull
make clean
make -j12 CLANG=1 CCACHE=1 RELEASE=1 TILES=1 SOUND=1 LUA=1 USE_XDG_DIR=1
./cataclysm-tiles

You know that the game is precompiled in the official repo?

pamac install cataclysm-dda-tiles

Anyway… since it is git repo you can also reset it: git reset --hard so that it resets to the last commit. As you see above, I compiled it, and it worked without an issue.

Yes.
The game has a stable and experimental version. The stable versions are released about once a year and the experimental version can be updated multiple times a day. I’m pretty sure all the versions found in the official repo are from the stable release.
I’ve only ever played the experimental version.

I added git reset --hard to my script but I still got the same error.

#!/bin/bash

repo=("/home/satjwu/Cataclysm-DDA")

cd "${repo}"
git reset --hard
git pull
make clean
make -j12 CLANG=0 RELEASE=1 TILES=1 SOUND=1 LUA=1 USE_XDG_DIR=1

./cataclysm-tiles

What should I include from:

$ make -j$(nproc) PREFIX=$PWD/install CLANG=0 CCACHE=1 NATIVE=linux64 RELEASE=1 TILES=1
CCACHE_SLOPPINESS=pch_defines,time_macros,include_file_ctime,include_file_mtime ccache g++ -Os -Wodr -Werror -Wall -Wextra -Wformat-signedness -Wlogical-op -Wmissing-declarations -Wmissing-noreturn -Wnon-virtual-dtor -Wold-style-cast -Woverloaded-virtual -Wpedantic -Wsuggest-override -Wunused-macros -Wzero-as-null-pointer-constant -Wno-unknown-warning-option -Wno-dangling-reference -Wno-c++20-compat -Wredundant-decls -fsigned-char -std=c++17 -m64 -I/usr/include/SDL2 -I/usr/include/libpng16 -DHWY_SHARED_DEFINE -I/usr/include/webp -D_REENTRANT -MMD -MP -DCATA_IN_TOOL -Itools/format -Isrc -isystem src/third-party \
  tools/format/format.cpp tools/format/format_main.cpp src/json.cpp -o tools/format/json_formatter.cgi
Cannot run an astyle check, your system either does not have astyle, or it is too old.
grep: src/PREFIX.h: Datei oder Verzeichnis nicht gefunden
// NOLINT(cata-header-guard)
#define PREFIX "/storage/Projekte/github.com/Cataclysm-DDA/install"
CCACHE_SLOPPINESS=pch_defines,time_macros,include_file_ctime,include_file_mtime ccache g++ -Isrc -isystem src/third-party -DRELEASE -DGIT_VERSION -DTILES -DBACKTRACE -DLOCALIZE -DPREFIX="/storage/Projekte/github.com/Cataclysm-DDA/install" -DDATA_DIR_PREFIX -Os -Wodr -Werror -Wall -Wextra -Wformat-signedness -Wlogical-op -Wmissing-declarations -Wmissing-noreturn -Wnon-virtual-dtor -Wold-style-cast -Woverloaded-virtual -Wpedantic -Wsuggest-override -Wunused-macros -Wzero-as-null-pointer-constant -Wno-unknown-warning-option -Wno-dangling-reference -Wno-c++20-compat -Wredundant-decls -fsigned-char -std=c++17 -m64 -I/usr/include/SDL2 -I/usr/include/libpng16 -DHWY_SHARED_DEFINE -I/usr/include/webp -D_REENTRANT -MMD -MP -Wno-error -c pch/main-pch.hpp -o pch/main-pch.hpp.gch

to my script?

Would restoring a system backup solve the issue or would it happen again as soon as I update the system?

When I look at the MakeFile, then I see this:

    719   else # not osx
    720     CXXFLAGS += $(shell $(PKG_CONFIG) --cflags sdl2 SDL2_image SDL2_ttf)
    721 
    722     ifeq ($(STATIC), 1)
    723       LDFLAGS += $(shell $(PKG_CONFIG) sdl2 --static --libs)
    724     else
    725       LDFLAGS += $(shell $(PKG_CONFIG) sdl2 --libs)
    726     endif
    727 
    728     LDFLAGS += -lSDL2_ttf -lSDL2_image
    729 
    730     # We don't use SDL_main -- we have proper main()/WinMain()
    731     CXXFLAGS := $(filter-out -Dmain=SDL_main,$(CXXFLAGS))
    732     LDFLAGS := $(filter-out -lSDL2main,$(LDFLAGS))
    733   endif

So it uses pkgconfig to find SDL2 and include it. Is pkgconfig installed? Probably it was removed as an orphan?

Test this:

 pkgconf --cflags sdl2 SDL2_image SDL2_ttf 

No.

Success! Thanks.

A guru to solve them…

is no lie.

TLDR: pkgconf was not installed and so I installed it. I restored /usr/include/SDL2/SDL.h to its original state. I ran my unedited update script and the game compiled successfully.

I ran

pkgconf --cflags sdl2 SDL2_image SDL2_ttf

and I got

bash: pkgconf: command not found

I installed pkgconf.

I ran my update script and there’s different errors now:

ENTRANT -MMD -MP -Winvalid-pch -include-pch pch/main-pch.hpp.pch -c src/ballistics.cpp -o obj/tiles/ballistics.o
In file included from src/animation.cpp:29:
In file included from src/cata_tiles.h:25:
In file included from src/sdl_wrappers.h:13:
In file included from /usr/include/SDL2/SDL.h:40:
In file included from /usr/include/SDL2/SDL_main.h:25:
/usr/include/SDL2/SDL_stdinc.h:186:5: error: redefinition of enumerator 'SDL_FALSE'
    SDL_FALSE = 0,
    ^
/usr/include/SDL/SDL_stdinc.h:50:5: note: previous definition is here
    SDL_FALSE,
    ^
In file included from src/animation.cpp:29:
In file included from src/cata_tiles.h:25:
In file included from src/sdl_wrappers.h:13:
In file included from /usr/include/SDL2/SDL.h:40:
In file included from /usr/include/SDL2/SDL_main.h:25:
/usr/include/SDL2/SDL_stdinc.h:187:5: error: redefinition of enumerator 'SDL_TRUE'
    SDL_TRUE = 1
    ^
/usr/include/SDL/SDL_stdinc.h:51:5: note: previous definition is here
    SDL_TRUE
    ^
In file included from src/animation.cpp:29:
In file included from src/cata_tiles.h:25:
In file included from src/sdl_wrappers.h:13:
In file included from /usr/include/SDL2/SDL.h:40:
In file included from /usr/include/SDL2/SDL_main.h:25:
/usr/include/SDL2/SDL_stdinc.h:188:3: error: typedef redefinition with different types ('enum SDL_bool' vs 'enum SDL_bool')
} SDL_bool;
  ^
/usr/include/SDL/SDL_stdinc.h:52:3: note: previous definition is here
} SDL_bool;
  ^
In file included from src/animation.cpp:29:
In file included from src/cata_tiles.h:25:
In file included from src/sdl_wrappers.h:13:
In file included from /usr/include/SDL2/SDL.h:40:
In file included from /usr/include/SDL2/SDL_main.h:25:
/usr/include/SDL2/SDL_stdinc.h:417:5: error: redefinition of enumerator 'DUMMY_ENUM_VALUE'
    DUMMY_ENUM_VALUE
    ^
/usr/include/SDL/SDL_stdinc.h:75:5: note: previous definition is here
    DUMMY_ENUM_VALUE
    ^
In file included from src/animation.cpp:29:
In file included from src/cata_tiles.h:25:
In file included from src/sdl_wrappers.h:13:
In file included from /usr/include/SDL2/SDL.h:40:
In file included from /usr/include/SDL2/SDL_main.h:25:
/usr/include/SDL2/SDL_stdinc.h:418:3: error: typedef redefinition with different types ('enum SDL_DUMMY_ENUM' vs 'enum SDL_DUMMY_ENUM')
} SDL_DUMMY_ENUM;
  ^
/usr/include/SDL/SDL_stdinc.h:76:3: note: previous definition is here
} SDL_DUMMY_ENUM;
  ^
In file included from src/animation.cpp:29:
In file included from src/cata_tiles.h:25:
In file included from src/sdl_wrappers.h:13:
In file included from /usr/include/SDL2/SDL.h:40:
In file included from /usr/include/SDL2/SDL_main.h:25:
/usr/include/SDL2/SDL_stdinc.h:529:23: error: expected unqualified-id
SDL_FORCE_INLINE void SDL_memset4(void *dst, Uint32 val, size_t dwords)
                      ^
/usr/include/SDL/SDL_stdinc.h:368:39: note: expanded from macro 'SDL_memset4'
#define SDL_memset4(dst, val, dwords) do { \
                                      ^
In file included from src/animation.cpp:29:
In file included from src/cata_tiles.h:25:
In file included from src/sdl_wrappers.h:13:
In file included from /usr/include/SDL2/SDL.h:40:
In file included from /usr/include/SDL2/SDL_main.h:25:
/usr/include/SDL2/SDL_stdinc.h:529:23: error: while loop outside of a function
/usr/include/SDL/SDL_stdinc.h:381:5: note: expanded from macro 'SDL_memset4'
  } while (0)
    ^
In file included from src/animation.cpp:29:
In file included from src/cata_tiles.h:25:
In file included from src/sdl_wrappers.h:13:
In file included from /usr/include/SDL2/SDL.h:40:
In file included from /usr/include/SDL2/SDL_main.h:25:
/usr/include/SDL2/SDL_stdinc.h:583:31: error: 'strchr' is missing exception specification 'noexcept(true)'
extern DECLSPEC char *SDLCALL SDL_strchr(const char *str, int c);
                              ^
/usr/include/SDL/SDL_stdinc.h:245:20: note: expanded from macro 'SDL_strchr'
#define SDL_strchr strchr
                   ^
/usr/include/string.h:239:1: note: previous declaration is here
strchr (const char *__s, int __c) __THROW
^
In file included from src/animation.cpp:29:
In file included from src/cata_tiles.h:25:
In file included from src/sdl_wrappers.h:13:
In file included from /usr/include/SDL2/SDL.h:40:
In file included from /usr/include/SDL2/SDL_main.h:25:
/usr/include/SDL2/SDL_stdinc.h:584:31: error: 'strrchr' is missing exception specification 'noexcept(true)'
extern DECLSPEC char *SDLCALL SDL_strrchr(const char *str, int c);
                              ^
/usr/include/SDL/SDL_stdinc.h:251:21: note: expanded from macro 'SDL_strrchr'
#define SDL_strrchr strrchr
                    ^
/usr/include/string.h:266:1: note: previous declaration is here
strrchr (const char *__s, int __c) __THROW
^
In file included from src/animation.cpp:29:
In file included from src/cata_tiles.h:25:
In file included from src/sdl_wrappers.h:13:
In file included from /usr/include/SDL2/SDL.h:40:
In file included from /usr/include/SDL2/SDL_main.h:25:
/usr/include/SDL2/SDL_stdinc.h:585:31: error: 'strstr' is missing exception specification 'noexcept(true)'
extern DECLSPEC char *SDLCALL SDL_strstr(const char *haystack, const char *needle);
                              ^
/usr/include/SDL/SDL_stdinc.h:257:20: note: expanded from macro 'SDL_strstr'
#define SDL_strstr strstr
                   ^
/usr/include/string.h:343:1: note: previous declaration is here
strstr (const char *__haystack, const char *__needle) __THROW
^
In file included from src/animation.cpp:29:
In file included from src/cata_tiles.h:25:
In file included from src/sdl_wrappers.h:13:
In file included from /usr/include/SDL2/SDL.h:40:
In file included from /usr/include/SDL2/SDL_main.h:25:
/usr/include/SDL2/SDL_stdinc.h:591:31: error: redefinition of 'SDL_ltoa' as different kind of symbol
extern DECLSPEC char *SDLCALL SDL_itoa(int value, char *str, int radix);
                              ^
/usr/include/SDL/SDL_stdinc.h:409:40: note: expanded from macro 'SDL_itoa'
#define SDL_itoa(value, string, radix) SDL_ltoa((long)value, string, radix)
                                       ^
/usr/include/SDL/SDL_stdinc.h:265:32: note: previous definition is here
extern DECLSPEC char * SDLCALL SDL_ltoa(long value, char *string, int radix);
                               ^
In file included from src/animation.cpp:29:
In file included from src/cata_tiles.h:25:
In file included from src/sdl_wrappers.h:13:
In file included from /usr/include/SDL2/SDL.h:40:
In file included from /usr/include/SDL2/SDL_main.h:25:
/usr/include/SDL2/SDL_stdinc.h:591:44: error: expected '(' for function-style cast or type construction
extern DECLSPEC char *SDLCALL SDL_itoa(int value, char *str, int radix);
                                       ~~~ ^
/usr/include/SDL/SDL_stdinc.h:409:55: note: expanded from macro 'SDL_itoa'
#define SDL_itoa(value, string, radix) SDL_ltoa((long)value, string, radix)
                                                      ^~~~~
In file included from src/animation.cpp:29:
In file included from src/cata_tiles.h:25:
In file included from src/sdl_wrappers.h:13:
In file included from /usr/include/SDL2/SDL.h:40:
In file included from /usr/include/SDL2/SDL_main.h:25:
/usr/include/SDL2/SDL_stdinc.h:591:56: error: expected '(' for function-style cast or type construction
extern DECLSPEC char *SDLCALL SDL_itoa(int value, char *str, int radix);
                                                  ~~~~ ^
/usr/include/SDL/SDL_stdinc.h:409:62: note: expanded from macro 'SDL_itoa'
#define SDL_itoa(value, string, radix) SDL_ltoa((long)value, string, radix)
                                                             ^~~~~~
In file included from src/animation.cpp:29:
In file included from src/cata_tiles.h:25:
In file included from src/sdl_wrappers.h:13:
In file included from /usr/include/SDL2/SDL.h:40:
In file included from /usr/include/SDL2/SDL_main.h:25:
/usr/include/SDL2/SDL_stdinc.h:591:57: error: use of undeclared identifier 'str'
extern DECLSPEC char *SDLCALL SDL_itoa(int value, char *str, int radix);
                                                        ^
/usr/include/SDL2/SDL_stdinc.h:591:66: error: expected '(' for function-style cast or type construction
extern DECLSPEC char *SDLCALL SDL_itoa(int value, char *str, int radix);
                                                             ~~~ ^
/usr/include/SDL/SDL_stdinc.h:409:70: note: expanded from macro 'SDL_itoa'
#define SDL_itoa(value, string, radix) SDL_ltoa((long)value, string, radix)
                                                                     ^~~~~
In file included from src/animation.cpp:29:
In file included from src/cata_tiles.h:25:
In file included from src/sdl_wrappers.h:13:
In file included from /usr/include/SDL2/SDL.h:40:
In file included from /usr/include/SDL2/SDL_main.h:25:
/usr/include/SDL2/SDL_stdinc.h:592:31: error: redefinition of 'SDL_ultoa' as different kind of symbol
extern DECLSPEC char *SDLCALL SDL_uitoa(unsigned int value, char *str, int radix);
                              ^
/usr/include/SDL/SDL_stdinc.h:410:41: note: expanded from macro 'SDL_uitoa'
#define SDL_uitoa(value, string, radix) SDL_ultoa((long)value, string, radix)
                                        ^
/usr/include/SDL/SDL_stdinc.h:271:32: note: previous definition is here
extern DECLSPEC char * SDLCALL SDL_ultoa(unsigned long value, char *string, int radix);
                               ^
In file included from src/animation.cpp:29:
In file included from src/cata_tiles.h:25:
In file included from src/sdl_wrappers.h:13:
In file included from /usr/include/SDL2/SDL.h:40:
In file included from /usr/include/SDL2/SDL_main.h:25:
/usr/include/SDL2/SDL_stdinc.h:592:50: error: expected '(' for function-style cast or type construction
extern DECLSPEC char *SDLCALL SDL_uitoa(unsigned int value, char *str, int radix);
                                        ~~~~~~~~ ^
/usr/include/SDL/SDL_stdinc.h:410:57: note: expanded from macro 'SDL_uitoa'
#define SDL_uitoa(value, string, radix) SDL_ultoa((long)value, string, radix)
                                                        ^~~~~
In file included from src/animation.cpp:29:
In file included from src/cata_tiles.h:25:
In file included from src/sdl_wrappers.h:13:
In file included from /usr/include/SDL2/SDL.h:40:
In file included from /usr/include/SDL2/SDL_main.h:25:
/usr/include/SDL2/SDL_stdinc.h:592:66: error: expected '(' for function-style cast or type construction
extern DECLSPEC char *SDLCALL SDL_uitoa(unsigned int value, char *str, int radix);
                                                            ~~~~ ^
/usr/include/SDL/SDL_stdinc.h:410:64: note: expanded from macro 'SDL_uitoa'
#define SDL_uitoa(value, string, radix) SDL_ultoa((long)value, string, radix)
                                                               ^~~~~~
In file included from src/animation.cpp:29:
In file included from src/cata_tiles.h:25:
In file included from src/sdl_wrappers.h:13:
In file included from /usr/include/SDL2/SDL.h:40:
In file included from /usr/include/SDL2/SDL_main.h:25:
/usr/include/SDL2/SDL_stdinc.h:592:67: error: use of undeclared identifier 'str'
extern DECLSPEC char *SDLCALL SDL_uitoa(unsigned int value, char *str, int radix);
                                                                  ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Makefile:995: obj/tiles/animation.o] Error 1
make: *** Waiting for unfinished jobs....

I removed

#include <SDL/SDL.h>
#include <SDL2/SDL.h>
#include "SDL/SDL.h"
#include "SDL2/SDL.h"
# include <SDL/SDL.h>
# include <SDL2/SDL.h>
# include "SDL/SDL.h"
# include "SDL2/SDL.h"

from /usr/include/SDL2/SDL.h
I ran my update script again and it successfully compiled.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.