Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Link error (unresolved externals)?!

10 views
Skip to first unread message

creative22

unread,
Apr 3, 2010, 7:04:01 AM4/3/10
to
Hi all

I'm using visual studio 2008;

I've installed Windows SDK(Platform SDK) recently and try to build some
sample codes of it, but I have problems!

When I build a sample code named "sampssp" of type "console application" and
"empty", I see this link error:


1>------ Build started: Project: sampssp, Configuration: Debug Win32 ------
1>Compiling...
1>Init.c
1>Stubs.c
1>Generating Code...
1>Compiling resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Compiling manifest to resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Linking...
1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main
referenced in function ___tmainCRTStartup
1>C:\Documents and Settings\Bahareh\My Documents\Visual Studio
2008\Projects\sampssp\Debug\sampssp.exe : fatal error LNK1120: 1 unresolved
externals
1>Build log was saved at "file://c:\Documents and Settings\Bahareh\My
Documents\Visual Studio 2008\Projects\sampssp\sampssp\Debug\BuildLog.htm"
1>sampssp - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


I added the "msvcrtd.lib" into "additional dependency" section, but the
problem wasn't resolved!

What should I do?

Please help...

John H.

unread,
Apr 26, 2010, 11:57:13 AM4/26/10
to
On Apr 3, 6:04 am, creative22 <creativ...@discussions.microsoft.com>
wrote:

> When I build a sample code named "sampssp" of type "console application" and
> "empty", I see this link error:
> 1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main
> referenced in function ___tmainCRTStartup

Do you have a main() function defined? Maybe if you posted a
simplified version of your code, we could diagnose it.

0 new messages