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
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old December 17th, 2008, 06:58 AM
Registered User
 
Join Date: Sep 2008
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Question Link error after adding serialize in sketcher

Before I add serialize to Element (Both .h and .cpp), My sketcher compile well.
After I add serialize in ch17 (until to page 881 in ivor 2005 book), when I compile I got this message

------ Build started: Project:
Sketcher, Configuration: Debug Win32 ------
Linking...
Elements.obj : error LNK2019: unresolved external symbol "protected: __thiscall CLine::CLine(void)" (??0CLine@@IAE@XZ) referenced in function "public: static class CObject * __stdcall CLine::CreateObject(void)" (?CreateObject@CLine@@SGPAVCObject@@XZ)
Elements.obj : error LNK2019: unresolved external symbol "protected: __thiscall CRectangle::CRectangle(void)" (??0CRectangle@@IAE@XZ) referenced in function "public: static class CObject * __stdcall CRectangle::CreateObject(void)" (?CreateObject@CRectangle@@SGPAVCObject@@XZ)
Elements.obj : error LNK2019: unresolved external symbol "protected: __thiscall CCircle::CCircle(void)" (??0CCircle@@IAE@XZ) referenced in function "public: static class CObject * __stdcall CCircle::CreateObject(void)" (?CreateObject@CCircle@@SGPAVCObject@@XZ)
Elements.obj : error LNK2019: unresolved external symbol "protected: __thiscall CCurve::CCurve(void)" (??0CCurve@@IAE@XZ) referenced in function "public: static class CObject * __stdcall CCurve::CreateObject(void)" (?CreateObject@CCurve@@SGPAVCObject@@XZ)
Elements.obj : error LNK2019: unresolved external symbol "protected: __thiscall CEllipse::CEllipse(void)" (??0CEllipse@@IAE@XZ) referenced in function "public: static class CObject * __stdcall CEllipse::CreateObject(void)" (?CreateObject@CEllipse@@SGPAVCObject@@XZ)
C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\Sketcher\Debug\Sketcher.exe : fatal error LNK1120: 5 unresolved externals
Build log was saved at "file://c:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\Sketcher\Sketcher\Debug\BuildLog.htm "
Sketcher - 6 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I am try to compare my sketcher with ivor's code (download from wrox website).But it's not differrent. I am not sure I am do something wrong. Anyone can help me please...
Thank for advance
Chang
Reply With Quote
  #2 (permalink)  
Old December 20th, 2008, 08:25 AM
Registered User
 
Join Date: Sep 2008
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Answer

Now I can solve that problem. Thank you for your read.
Reply With Quote
  #3 (permalink)  
Old October 2nd, 2010, 10:24 PM
Registered User
 
Join Date: Oct 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Serialization

I'm having the same issue when I try to compile after adding the serilization code. Does anyone have an answer to this problem.
Reply With Quote
  #4 (permalink)  
Old October 29th, 2011, 05:33 PM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default my solution

I know it's too late to answer your question but I am sure someone will run into the same problem one day.
My solution to the problem was as simple as adding a constructor for each of the elements in the Elements class.
Add the following lines in the Elements.cpp file:

CLine::CLine()
{
}
CRectangle::CRectangle()
{
}
CCircle::CCircle()
{
}
CCurve::CCurve()
{
}
CEllipse::CEllipse()
{
}

For some reason when I added the constructor for the Text class I got an error that the function already has a body so just forget about the Text constructor definition.
I hope this helps
Regards,
Marwa
Reply With Quote
Reply


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
1>Sketcher - 284 error(s), 3 warning(s) shade cat BOOK: Ivor Horton's Beginning Visual C++ 2005 1 July 21st, 2008 09:50 PM
Linker Error when buidling Sketcher - Chapter 14 Spasticus BOOK: Ivor Horton's Beginning Visual C++ 2005 6 January 11th, 2008 03:52 AM
help!help me,please!(about serialize) gooood General .NET 2 July 12th, 2005 08:30 PM
Adding a visual grid to Sketcher esmith289 Wrox Book Feedback 1 October 29th, 2003 01:29 PM



All times are GMT -4. The time now is 01:20 AM.


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