Hello happy SDL coders
sorry to annoy you with what will probably appear to be a beginnerâs problem,
but after having googled during hours, you are my last hope before I either
turn crazy or erase my harddisk (or both).
Iâm trying to use SDL with Visual Studio .NET 2003, and I keep having the
linker complaining. Here is a typical message I get :
âessaisdl3 error LNK2019: symbole externe non r?solu _WinMain at 16 r?f?renc?
dans la fonction _WinMainCRTStartupâ
(unresolved external symbol _WinMain at 16 referenced in the function
__WinMainCRTStartup)
I tried everything that was written in the VisualC.html file. I tried many
things I found when googling⌠And I keep having this kind of messages.
Hereâs the typical code I try to compile :
#include âstdafx.hâ
#include âSDL.hâ
int main( int argc, char* argv[] )
{
return 0;
}
I canât get rid off #include âstdafx.hâ, or VisualStudio complains and says :
âfatal error C1010: fin de fichier inattendue lors de la recherche dâune
directive dâen-t?te pr?compil?â
(unsuspected end of file when searching for an inclusion directive)
I downloaded the sources of PearPC, as itâs an SDL project, and had a look at
how it handles main() :
====PearPC====
#ifdef main
// Get rid of stupid SDL main redefinitions
#undef main
extern âCâ int SDL_main(int argc, char *argv[])
{
return 0;
}
#endif
int main(int argc, char *argv[])
{
//code
}============
I added that to my code, but it changes nothing.
Iâm despaired.
Do you know whatâs going so wrong with my tryings?
Help would be much appreciated
Thanks,
/Julien
PS: here are things I tried :
- various VS project creations : 16 bits console, 32 bits console, Win32
application, ⌠- using multithreaded debug/release DLLs
- various names for main() : _main() , _tmain(), _WinMain(), âŚ
- adding the .lib files directly in the project, or copying them in VSâs libs
directory (same thing with header files) - with and without #include âstdafx.hâ
- various main() signatures
⌠and combinations of all that