Wrox Programmer Forums
Visual C++ Questions specific to Microsoft's Visual C++. For questions not specific to this Microsoft version, use the C++ Programming forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual C++ section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 30th, 2003, 11:43 AM
Registered User
Join Date: Jun 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default linker error

sometimes while building a project link error is thrown, while similar code runs perfectly in other projects? the error thrown is:

msvcrtd.lib(crtexe.obj) : error LNK2001: unresolved external symbol _main
Debug/keyboard4.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

keyboard4.exe - 2 error(s), 0 warning(s)

can anyone tell me why?
Old July 1st, 2003, 02:23 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma

Hi smukher

This error usually occurs when you intend to make
a win32 application with MFC support, but inadvertently
you select console application as the type of your

or when you by mistake add win32 application program
source files to a console application project.

Ankur Verma
.Net and C++ Specialist
Wiley Tech Support
Old July 2nd, 2003, 06:10 PM
Registered User
Join Date: Jun 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ahmed_y_h

You got this error because you did not include the CRT (C Runtime Library) in the compilation process.

Modify your project settings.
Go to Project >> Settings... menu item. Select Win32 Release from the Settings for combobox. Go to the C/C++ tab.
In the Preprocessor definitions box make sure
you delete any occurence of _MIN_CRT-like strings.

Ahmad Yassin
Microsoft Certified Professional

Similar Threads
Thread Thread Starter Forum Replies Last Post
Linker Error, Chapter 18 Spasticus BOOK: Ivor Horton's Beginning Visual C++ 2005 4 February 20th, 2008 05:04 AM
Linker error.help s_srivi1 Access VBA 4 November 12th, 2007 02:54 AM
Compiler linker error raja_welcomes Visual C++ 1 June 6th, 2007 11:17 AM
[Linker error] undefined reference philArmstead BOOK: Professional C++ 7 October 9th, 2005 05:40 PM
linker error while calling fortran from c rony C# 0 August 2nd, 2005 07:52 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.