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
| 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
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 17th, 2005, 06:10 PM
Registered User
Join Date: Nov 2005
Location: Harlingen, Texas, USA.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Link Problems with"unresolved external symbols"

:(When I task built the program described in Chapter 2 of Introduction to Visual C++ 6.0 by Ivor Horton (Document X03-58736-0598), pp 64-65;71-72, I had several problems with the compilation. I have 20 Lnk2001 error messages for various symbols. Most of the symbols, like __imp__DrawTextA@20 and __imp__DispatchMessageA@4 start with __imp__ as a prefix. Whee I look up each symbol after discarding the prefix, I am told that I have to import user32.lib. ;)

THE QUESTION: How do I include this library? Describe, as best as you can, the button clicks that get me where I need to go so that I can fill in the blanks that fix things.


Clayton E. Benignus
Reply With Quote
  #2 (permalink)  
Old November 17th, 2005, 10:34 PM
Registered User
Join Date: Nov 2005
Location: Harlingen, Texas, USA.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts

OK, I was able to accidentally solve the problem on my own. To tell the truth, I get a little bit absent minded about these fixes, so I'm going to record this fix here in case it comes up again:

1) When you discover what libraries you need, put their headers at the beginning of the program.

#include "stdafx.h"
#include "winuser.h"
#include "wingdi.h"
#include <ios.h>
#include <tchar.h>

2)Set the parameters:
     ;)In General, make sure the Microsoft Foundation Classes has
         the appropriate entry. In my case, it was "Use MFC in a
         shared DLL"

3) Project=>Settings=>Link
     ;)In Object/Library Modules, list the libraries. In may case,
     they were: user32.lib gdi32.lib .

That got rid of 98% of my compile problems. I am still having problems with:

MSVCRTD.lib(crtexe.obj):error LNK2001: unresolved external symbol _main

However, I got rid of most of the problems. I'll be researching this problem next.I may post on this later.
Reply With Quote
  #3 (permalink)  
Old November 22nd, 2005, 06:34 AM
Registered User
Join Date: Nov 2005
Location: chennai, TN, India.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

In vc++ you can add libraries by,
  Project>settings>link>projectoption....type the name of the library you want to have.

If you want to add the library folder to your application,
 Tools>options>directories>show directories for(select library) then double click the empty entry to browse and add your library folder

Reply With Quote

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
CH 14 - Link Error - Unresolved Razzy The Pug BOOK: Ivor Horton's Beginning Visual C++ 2005 2 March 18th, 2008 06:44 PM
Access external link to Excel in Sharepoint wortinguk Access 1 October 20th, 2006 10:32 AM
Unresolved External Symbol - LNK2019 Valke Visual C++ 2005 1 April 14th, 2006 02:44 PM
error LNK2019: unresolved external symbol tinawalt VS.NET 2002/2003 3 August 9th, 2005 07:59 AM
Relative Link to External Style Sheet arduk ASP.NET 1.0 and 1.1 Basics 1 June 18th, 2003 09:13 AM

All times are GMT -4. The time now is 10:18 PM.

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