• Advertisement

Archived

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

Small SDL error

This topic is 5551 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

Can''t find out what this stupid linking error wants. Can anyone help me? Linking... MSVCRT.lib(crtexew.obj) : error LNK2001: unresolved external symbol _WinMain@16 I am using some of the apclasses such as apvector, apstring in my program but I haven''t even done anything in the code but this: #ifdef WIN32 #include <windows.h> #endif #include <SDL.h> #include <stdio.h> #include <stdlib.h> #include "MPlayer.h" #include "MProperty.h" int main( int argc, char* argv[] ) { return 0; } Any help i can get i take, thanks.

Share this post


Link to post
Share on other sites
Advertisement
Your project is a WIN32 Application, which requires the entry function to be WinMain, you need to set your project to be a WIN32 Console Project.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I always set up my SDL projects as Win32 Application, and they work. Ive seen this error before, I think this has to do with not linking to the libraries right.

Share this post


Link to post
Share on other sites
You have to include "SDL_main.h" and link sdlmain.lib. It converts your int main(int argc,char*argv[]) function in a winmain one.
Your project must be a Win32 app project and you have to use "Multithreaded DLL" runtime library. To setup this (in VC++ 6), go to Project Settings->C/C++->Category Code Generation.

Share this post


Link to post
Share on other sites

  • Advertisement