Cannot find -lSDL2main, -lSDL

I started following Lazyfoo’s SDL and got stuck at the installs.

Basically, I’m running a windows 64 machine and put SDL2.dll on both System32 (for 32 bits) and SysWOW64 (for 64) and then I created a folder called mingw_dev_lib where I put the folders for the 32 bits SDL.

But when I compile with the makefile, it gives me this error message:

C:\Users\nyo\projects\misc\01_hello_SDL>mingw32-make.exe
g++ 01_hello_SDL.cpp -IC:\mingw_dev_lib\include\SDL2 -LC:\mingw_dev_lib\lib -w -Wl,-subsystem,windows -lmingw32 -lSDL2main -lSDL2 -o 01_hello_SDL
C:/TDM-GCC-64/bin/…/lib/gcc/x86_64-w64-mingw32/5.1.0/…/…/…/…/x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\mingw_dev_lib\lib/libSDL2main.a when searching for -lSDL2mai
n
C:/TDM-GCC-64/bin/…/lib/gcc/x86_64-w64-mingw32/5.1.0/…/…/…/…/x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\mingw_dev_lib\lib\libSDL2main.a when searching for -lSDL2mai
n
C:/TDM-GCC-64/bin/…/lib/gcc/x86_64-w64-mingw32/5.1.0/…/…/…/…/x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\mingw_dev_lib\lib/libSDL2main.a when searching for -lSDL2mai
n
C:/TDM-GCC-64/bin/…/lib/gcc/x86_64-w64-mingw32/5.1.0/…/…/…/…/x86_64-w64-mingw32/bin/ld.exe: cannot find -lSDL2main
C:/TDM-GCC-64/bin/…/lib/gcc/x86_64-w64-mingw32/5.1.0/…/…/…/…/x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\mingw_dev_lib\lib/libSDL2.dll.a when searching for -lSDL2
C:/TDM-GCC-64/bin/…/lib/gcc/x86_64-w64-mingw32/5.1.0/…/…/…/…/x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\mingw_dev_lib\lib/libSDL2.a when searching for -lSDL2
C:/TDM-GCC-64/bin/…/lib/gcc/x86_64-w64-mingw32/5.1.0/…/…/…/…/x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\mingw_dev_lib\lib\libSDL2.a when searching for -lSDL2
C:/TDM-GCC-64/bin/…/lib/gcc/x86_64-w64-mingw32/5.1.0/…/…/…/…/x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\mingw_dev_lib\lib/libSDL2.dll.a when searching for -lSDL2
C:/TDM-GCC-64/bin/…/lib/gcc/x86_64-w64-mingw32/5.1.0/…/…/…/…/x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:\mingw_dev_lib\lib/libSDL2.a when searching for -lSDL2
C:/TDM-GCC-64/bin/…/lib/gcc/x86_64-w64-mingw32/5.1.0/…/…/…/…/x86_64-w64-mingw32/bin/ld.exe: cannot find -lSDL2
collect2.exe: error: ld returned 1 exit status
Makefile:26: recipe for target ‘all’ failed
mingw32-make.exe: *** [all] Error 1

Whereas if I put the 64bits folders on mingw_dev_lib it compiles with no problems, but then the exe doesn’t run.

For the tutorial, should I put the SDL2.dll 32 bits on SysWOW64? Along with 32 bits folders for mingw_dev_lib? And do I need to compile with the flag -m32?

Edit: I fixed it, nvm.

How did you fixed that?

Please, tell me if you have found a solution. Thanks you