Skip to main content
GameDev.net gamedev.net
🔒 Locked

Linking Error

Started by robirt Aug 11, 2002 at 11:03 AM 5 replies 300+ views
Original Post
robirt
robirt
I am using sdl and openGL. They are the only libraries i added besides the default ones when you create a win32 porgram. please help. This is the erroe i get: MSVCRTD.lib(crtexew.obj) : error LNK2001: unresolved external symbol _WinMain@16
Rodger
felonius
felonius
when you make a win32 application then the function WinMain() must be defined by you. This error indicates that you did not not do that.
Jacob Marner, M.Sc.Console Programmer, Deadline Games
robirt
robirt
Im not defining winmain, since im using sdl. I am using th main function just like it tells me to in the sdl docs and i am including sdl.h
Is there anything else you know of that might be causing this problem?
Rodger
daerid
daerid
If you''re using VC++, you need to change the linker switch from /subsystem:windows to /subsystem:console
daerid@gmail.com
robirt
robirt
ok, i just tried that and it changed the error to:

MSVCRTD.lib(crtexe.obj) : error LNK2001: unresolved external symbol _main

BTW, i assume that is the same as making a ''win32 console app'' as opposed to ''win32 app''. since im using opengl, am i really supposed to do that?
Rodger
robirt
robirt
i solved my problem. The problem was i only added sdl.lib and forgot to add sdlmain.lib
Rodger

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.