• Announcements

Archived

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

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

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 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 on other sites
Thanks! It works!

• Partner Spotlight

• Forum Statistics

• Total Topics
627636
• Total Posts
2978331

• 10
• 12
• 22
• 13
• 33