Im having troubles with having my makefile compile my project. Normal make just builds the libary and everything is correct. But when i do make app it tells me undefined refrence to SDL_Main. Before i had lot more undefined refrences but i got them fixed when i changed the flags order. But now im having this problem and i cant figure out how to solve this.
You should be using main() instead of WinMain() even though you are creating a Windows application, because SDL provides a version of WinMain() which performs some SDL initialization before calling your main code. If for some reason you need to use WinMain(), take a look at the SDL source code in src/main/win32/SDL_main.c to see what kind of initialization you need to do in your WinMain() function so that SDL works properly.
I hope this solves your problem.
But in that case you should try googeling before asking questions :)
If that does not solve your problem we will have a hard time figuring out where the problem is, we can just guess.
After playing around for hours i got rid of the undefined refrence to SDL_Main but all the other undefined refrences came back.
I dont quite undertand sdl-config --cflags --libs this thing in the wiki page suggested above.
I have googled alot, but everything i have tryed doesent work. My one guess is that when im compiling my source files, SDL stuff is not included, but then why dont i get error message sooner. Or maybe is there something wrong with the way i create my libary?
I tryed. Cant the error be on line #34 or maybe on line #30? because these line take care of generating the libary and the error is all about libary .o files
SDL wiki says to chekc if sdl-config follows my source on command line
When you're compiling with gcc, you need to make sure the output of sdl-config follows your source file on the command line: gcc -o test test.c sdl-config --cflags --libs
So i added sdl-config --cflags --libs to my command and i got somekind of weird location