[SDL] Setup errors, VC++ .NET

Started by
2 comments, last by Mushu 18 years, 2 months ago
Althogh I'm not too new to programing, I'm just begining with graphics.. Anyway, I've been trying to install SDL on my copy of Visual Studio .NET, but keep getting the following problems, even after following the instructions from various sites: Linking... MSVCRTD.lib(cinitexe.obj) : warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library SDLmain.lib(SDL_win32_main.obj) : error LNK2019: unresolved external symbol _SDL_main referenced in function _main Debug/Vacuus_2D.exe : fatal error LNK1120: 1 unresolved externals I've added the SDL lib/include directories to the VC list, changed to a Multi-Threaded DLL, and added the 2 required library files {SDL.lib, SDLmain.lib} So, does anyone have any idea whats going on here? I'ld figure it out myself - but, the little programming experience I have prohibits me from undetstanding those errors... Thanks
Advertisement
Your main function has to be: int main(int argc, char* argv[]) SDL is very picky about this, and will give you that error when it can't find an exact match.
Ahhh, o.k - thanks for your help.
In addition, to get rid of that linker warning (if the compiler doesn't automagically ignore it for you) is to add MSVCRT.LIB to the ignore list in Project Settings (Properties) > Linker > Input > Ignore Specific Library.

Or, since you're using MSVC, you can use a pragma command to do it -

#pragma comment (linker, "/NODEFAULTLIB:\"MSVCRT.LIB\"")

This topic is closed to new replies.

Advertisement