Archived

This topic is now archived and is closed to further replies.

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

This topic is 5535 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites