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++ > BOOK: Ivor Horton's Beginning Visual C++ 2005
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Ivor Horton's Beginning Visual C++ 2005
This is the forum to discuss the Wrox book Ivor Horton's Beginning Visual C++ 2005 by Ivor Horton; ISBN: 9780764571978
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Ivor Horton's Beginning Visual C++ 2005 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 Display Modes
  #1 (permalink)  
Old March 17th, 2008, 11:41 PM
Registered User
 
Join Date: Mar 2008
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default CH 14 - Link Error - Unresolved

Hi all.††I am getting the following error:
1>Elements.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CLine::Draw(class CDC *)" (?Draw@CLine@@UAEXPAVCDC@@@Z)
1>C:\Documents and Settings\Razzy\My Documents\Visual Studio 2005\Projects\Sketcher\Debug\Sketcher.exe : fatal error LNK1120: 1 unresolved externals

It pops up when I add the following line to elements.h, the CLine Class:

virtual void Draw(CDC* pDC);

I don't believe that this is a unicode issue, as I read that thread and tried the solution.††Everything works fine until I add that one line.††And yes, I added the #include "Elements.h" line everywhere the book told me to.

Any help would be appreciated.

thanks,
Razzy
  #2 (permalink)  
Old March 18th, 2008, 05:52 PM
Authorized User
 
Join Date: Feb 2007
Location: , , United Kingdom.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Razzy,

You may have already tried this, so sorry if I'm telling you something you already know. From the error given here, it looks like you may be trying to build your code without having included your implementation of the 'Cline::Draw' function in 'Elements.cpp'.

I can replicate your linker error in my sketcher program by commenting out the implementation of the 'Cline::Draw' function in 'Elements.cpp'.

I hope this helps.

Dan

  #3 (permalink)  
Old March 18th, 2008, 07:44 PM
Registered User
 
Join Date: Mar 2008
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dan,

Thanks. You are correct. I should have read a couple more pages of the book.

Razzy
 


Thread Tools
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 file errors caseyc BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 10 February 28th, 2006 03:59 PM
error LNK2020 unresolved token rachappa Visual C++ 1 January 12th, 2006 08:05 AM
Link Problems with"unresolved external symbols" ConstantineAugustus Visual C++ 2 November 22nd, 2005 06:34 AM
CH. 14 Stored Procedure mcauliff BOOK: Beginning ASP 3.0 1 October 4th, 2005 02:52 PM
Ch. 14 Calendar Modification Astalder BOOK: Beginning ASP.NET 1.0 6 December 1st, 2004 06:23 PM



All times are GMT -4. The time now is 10:50 AM.


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