What is the right way to use IMG_Load(const char*) on macOS Mojave and Ubuntu 18?
I’m following the Let’s Make Games tutorial on youtube, specifically the TextureManager one: https://youtu.be/RqvpkZ7I1aU
I can open a window with SDL2 but IMG_Load(cost char*) can’t be referenced.
On macOS Mojave I’m using CLion 2019.2 just to write the code, building and compiling on the command line with CMake 3.15.3, and have installed sdl2 and sdl2_image using brew. The SDL.h and SLD_image.h files are in usr/local/include/SDL2/. Neither CLion nor CMake (using clang++ I think) find the SDL_image.h header file.
I’ve tried using
#include <SDL_image/SDL_image.h>
and
#include <SDL_image.h>
and
#include “SDL_image.h”
I see that file /usr/local/include/SDL2/SDL.h does not reference /usr/local/include/SDL2/SDL_image.h. So we must have to include it separately. But I’m very confused why <SDL.h> works and <SDL_image.h> doesn’t.
On Ubuntu 18.04.3 LTS (running on VMWare Professional Version 10.1.6) the headers are /usr/include/SDL2/SDL.h and /usr/include/SDL2/SDL_image.h. I installed libsdl2-image-2.0-0 and libsdl2-image-dev as well as other libsdl2 dev using apt.
Any help is appreciated. Thanks,
-boz