Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > Visual C++
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 30th, 2003, 11:43 AM
Registered User
 
Join Date: Jun 2003
Location: NewDelhi, Delhi, India.
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:

********************************
Compiling...
keyboard4.cpp
Linking...
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?
Reply With Quote
  #2 (permalink)  
Old July 1st, 2003, 02:23 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
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
Default

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
project.

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
Reply With Quote
  #3 (permalink)  
Old July 2nd, 2003, 06:10 PM
Registered User
 
Join Date: Jun 2003
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ahmed_y_h
Default

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
Alliedsoft
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 02:03 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.