Jump to content
  • Advertisement
Sign in to follow this  
Khel-dar

WinMain Linker Error

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

Recently reinstalled XP and VS Studio Pro 05 and today got around to opening my projects again. However I get WinMain linker errors. I haven't changed any of the code since I last built it before the reinstall. Even a new project with just an empty win main gets the error. I created a Win32 Project. Its set to /SUBSYSTEM:Windows. I also tried manually setting the Entry Point (in Linker options) to be the Win32 which didn't work. I think I've been stupid and missed setting an option, but I have no idea what it was >< Thanks. The error.
Quote:
MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup C:\Projects\ix\Debug\ix.exe : fatal error LNK1120: 1 unresolved externals
Empty WinMain I'm trying to build:
#define WIN32_LEAN_AND_MEAN
#include <windows.h>

int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow)
{
	return 0;
}

Share this post


Link to post
Share on other sites
Advertisement
You have unicode enabled, so the entry point is a little bit different - LPTSTR instead of LPSTR, for one. Try disabling it.

Share this post


Link to post
Share on other sites
Quote:
Original post by Oluseyi
You have unicode enabled, so the entry point is a little bit different - LPTSTR instead of LPSTR, for one. Try disabling it.


The option in Configuration Properties -> General -> Character Set? I forgot to mention I have already set that to "Not Set".

Share this post


Link to post
Share on other sites
Quote:
Original post by Khel-dar
The option in Configuration Properties -> General -> Character Set? I forgot to mention I have already set that to "Not Set".


Set it to Multi-Byte to disable unicode.

Share this post


Link to post
Share on other sites
Quote:
Original post by Driv3MeFar
Quote:
Original post by Khel-dar
The option in Configuration Properties -> General -> Character Set? I forgot to mention I have already set that to "Not Set".


Set it to Multi-Byte to disable unicode.


Still can't link. I remember this happening the last time I installed but I have no idea what I did to fix it.

Edit:

Creating another project seems to build fine now. Odd. Thanks for the replies.

[Edited by - Khel-dar on September 28, 2007 5:31:26 PM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!