I am beginning to use the SDL library for the first time and I used the apt-get install to download it onto the windows subsystem (Ubuntu). When I make calls to functions from the SDL library and then run the makefile, I am presented with:
/home/display.c:13: undefined reference to `SDL_Init'
/home/display.c:14: undefined reference to `SDL_GetError'
/home/display.c:17: undefined reference to `SDL_CreateWindow'
/home/display.c:19: undefined reference to `SDL_GetError'
/home/display.c:22: undefined reference to `SDL_CreateRenderer'
/home/display.c:24: undefined reference to `SDL_GetError'
The makefile looks like:
gcc -Wall -Werror -Wextra -Wunused -std=gnu99 -g -O0 -Wpedantic -lpthread -lSDL2main -lSDL2
I believe the issue is in linking and that the compiler cannot find where SDL is. However, if this were the case, there should be an error stating that #include SDL2/SDL.h cannot be found. Could this be an installation issue or an issue with the way I link SDL in the makefile?
SDL_.... Perhaps it needs some help to find the library files, for examplelibSDL2.a. - the busybee