Jump to content
  • Advertisement

Archived

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

alnite

#include "sdl.h" => unresolved _main. wtf?

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

int main( int argc, char** argv ) {    return 0; } program works ok, but once I #include "sdl.h", I got error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup WTF? I use VS.NET 2002.

Share this post


Link to post
Share on other sites
Advertisement
Link against SDLmain.lib. The SDL.h header has a #define that renames main because the actual main for the program is contained in the library.

Share this post


Link to post
Share on other sites
Now I got this:

error LNK2005: __isctype already defined in LIBCD.lib(isctype.obj)
error LNK2005: _exit already defined in LIBCD.lib(crt0dat.obj)
error LNK2005: _fclose already defined in LIBCD.lib(fclose.obj)
error LNK2005: _strncpy already defined in LIBCD.lib(strncpy.obj)
fatal error LNK1169: one or more multiply defined symbols found
warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library



Why do I have to build it as Multi-threaded DLL? This is not a DLL..

[edited by - alnite on May 19, 2004 11:11:35 PM]

Share this post


Link to post
Share on other sites
You aren''t building it as a multi-threaded DLL; you''re linking against the multi-threaded DLL version of the C runtime library.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!