I am trying to install SDL2 for my C programs and I can't seem to get the library working.
So far, I've installed "SDL2-devel-2.0.14-mingw.tar.gz" and followed this website's instructions:
https://w3.cs.jmu.edu/bernstdh/web/common/help/cpp_mingw-sdl-setup.php
When I try to run and compile this test c file:
#include "SDL2/SDL.h"
int main( int argc, char* args[] ) {
SDL_Init( SDL_INIT_EVERYTHING ); //Start SDL
SDL_Quit(); //Quit SDL
return 0;
}
I get this error on VSCode:
C:\Users\kid\AppData\Local\Temp\cc6KBeOh.o:test.c:(.text+0xe): undefined reference to `SDL_Init'
C:\Users\kid\AppData\Local\Temp\cc6KBeOh.o:test.c:(.text+0x13): undefined reference to `SDL_Quit'
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../libmingw32.a(main.o):(.text.startup+0xa0): undefined reference to `WinMain@16'
collect2.exe: error: ld returned 1 exit status
I am confused as I copied and pasted the needed SDL files into MinGW and I also have SDL2.dll in my file directory.