A little trouble getting SDL to work in Dev C++

Started by
1 comment, last by Chocoboko 21 years, 6 months ago
Hello. I tried Dev C++ since I heard it was a good for SDL development. I just have a minor problem. I put "-lmingw32 -lsdlmain -lSDL" in the "Linker Options" box under Project Options. But when I try to compile the code, I get this error: C:\DEV-CPP\lib\libsdlmain.a(SDL_main.o.b) [Warning] In function `console_main'': [Linker error] undefined reference to `SDL_main'' It''s weird. I know that I included the SDL library and the compiler acknowledges that it''s there. If anyone knows the problem, can you please help me? Thank you.
Advertisement
The SDL 'main' hack requires that you have a 'main' function defined somewhere and that it takes all of the normally optional parameters (e.g. it must be int main(int argc, char *argv[])). SDL defines 'main' to SDL_main for this hack so that it can call it from an external library.



[edited by - Null and Void on October 15, 2002 11:35:40 PM]
Thanks! It works!

This topic is closed to new replies.

Advertisement