Visual 2010, error LNK2001: unresolved external symbol _WinMainCRTStartup

  • Follow


Hi, I'm just starting out with C++. I'm using MS Visual C++ 2010
Express. I have installed Windows SDK (although I'm not sure if I've
linked Visual to the SDK properly).

I'm just trying out the simple program on this page:
http://msdn.microsoft.com/en-us/library/ff381409(v=VS.85).aspx
But when I try to compile and run I get this error:


1>------ Build started: Project: propertest, Configuration: Debug
Win32 ------
1>LINK : error LNK2001: unresolved external symbol _WinMainCRTStartup
1>c:\users\alex\documents\visual studio 2010\Projects\propertest\Debug
\propertest.exe : fatal error LNK1120: 1 unresolved externals

Any ideas? :(
Even trying to compile a blank file gives this error. I think there is
an issue in the settings somewhere...
Thanks, Alex
0
Reply Chromana 7/16/2010 2:13:18 PM

Chromana <alex.monson@gmail.com>, on 16/07/2010 07:13:18, wrote:

> Hi, I'm just starting out with C++. I'm using MS Visual C++ 2010
> Express. I have installed Windows SDK (although I'm not sure if I've
> linked Visual to the SDK properly).
>
> I'm just trying out the simple program on this page:
> http://msdn.microsoft.com/en-us/library/ff381409(v=VS.85).aspx
> But when I try to compile and run I get this error:
>
>
> 1>------ Build started: Project: propertest, Configuration: Debug
> Win32 ------
> 1>LINK : error LNK2001: unresolved external symbol _WinMainCRTStartup
> 1>c:\users\alex\documents\visual studio 2010\Projects\propertest\Debug
> \propertest.exe : fatal error LNK1120: 1 unresolved externals
>
> Any ideas? :(
> Even trying to compile a blank file gives this error. I think there is
> an issue in the settings somewhere...

You guessed right, "unresolved external symbol" errors get raised when 
you miss to add the proper libraries to your project - i.e. settings 
problem. Though, since I'm not experienced with VS, I cannot directly 
help you - furthermore, compiler specific issues are off-topic here.

Search the web for "visual studio unresolved external symbol" and you'll 
get plenty of similar cases, eventually you'll get pointers on how to 
solve it.

Consider also posting to an MS group or forum - here we usually discuss 
issues strictly related to the C++ language, not to the tools that use it.

-- 
  FSC - http://userscripts.org/scripts/show/59948
  http://fscode.altervista.org - http://sardinias.com
0
Reply entuland (631) 7/16/2010 2:19:29 PM


On 7/16/2010 10:13 AM, Chromana wrote:
> Hi, I'm just starting out with C++. I'm using MS Visual C++ 2010
> Express. I have installed Windows SDK (although I'm not sure if I've
> linked Visual to the SDK properly).
>
> I'm just trying out the simple program on this page:
> http://msdn.microsoft.com/en-us/library/ff381409(v=VS.85).aspx
> But when I try to compile and run I get this error:
>
>
> 1>------ Build started: Project: propertest, Configuration: Debug
> Win32 ------
> 1>LINK : error LNK2001: unresolved external symbol _WinMainCRTStartup
> 1>c:\users\alex\documents\visual studio 2010\Projects\propertest\Debug
> \propertest.exe : fatal error LNK1120: 1 unresolved externals
>
> Any ideas? :(
> Even trying to compile a blank file gives this error. I think there is
> an issue in the settings somewhere...

Yes, it's in settings most likely.  The linker does not know where to 
find the libraries (.lib) for your SDK.  However, this is not a C++ 
problem, it's a problem with your installation of the two Microsoft 
products, and as such this is off-topic, sorry.

There used to be the newsgroup microsoft.public.vc.ide_general (among a 
few others with 'microsoft.public.vc' in the name), and that's where you 
could post a question on how to set your IDE to pick up the libraries 
from some other place.  But I am not sure it's active anymore, my news 
provider *removed* those newsgroups from its list.  Try looking on the 
MS web site[s] for their online forums.

V
-- 
I do not respond to top-posted replies, please don't ask
0
Reply Victor 7/16/2010 2:31:33 PM

2 Replies
1105 Views

(page loaded in 0.069 seconds)

Similiar Articles:







7/22/2012 10:11:02 PM


Reply: