Wrox Programmer Forums
|
BOOK: Ivor Horton's Beginning Visual C++ 2010
This is the forum to discuss the Wrox book Ivor Horton's Beginning Visual C++ 2010 by Ivor Horton; ISBN: 9780470500880
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Ivor Horton's Beginning Visual C++ 2010 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 March 29th, 2011, 06:42 PM
xfm xfm is offline
Registered User
 
Join Date: Mar 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ex8_09.cpp compilation failed

I tried to compile the file using Visual Studio C ++ 2008 but it failed as below:

1>------ Rebuild All started: Project: Ex8, Configuration: Debug Win32 ------
1>Deleting intermediate and output files for project 'Ex8', configuration 'Debug|Win32'
1>Compiling...
1>Ex8_09.cpp
1>c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(40) : error C2143: syntax error : missing ')' before '&&'
1>c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(40) : error C2143: syntax error : missing ';' before '&&'
1>c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(40) : error C2652: 'CText' : illegal copy constructor: first parameter must not be a 'CText'
1> c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(10) : see declaration of 'CText'
1>c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(40) : error C2059: syntax error : ')'
1>c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(40) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(73) : error C2143: syntax error : missing ')' before '&&'
1>c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(73) : error C2143: syntax error : missing ';' before '&&'
1>c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(73) : error C2059: syntax error : ')'
1>c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(74) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(95) : warning C4521: 'CText' : multiple copy constructors specified
1>c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(95) : warning C4522: 'CText' : multiple assignment operators specified
1>c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(130) : error C2143: syntax error : missing ')' before '&&'
1>c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(130) : error C2143: syntax error : missing ';' before '&&'
1>c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(130) : error C2059: syntax error : ')'
1>c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(131) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(153) : error C2143: syntax error : missing ')' before '&&'
1>c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(153) : error C2143: syntax error : missing ';' before '&&'
1>c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(153) : error C2652: 'CMessage' : illegal copy constructor: first parameter must not be a 'CMessage'
1> c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(98) : see declaration of 'CMessage'
1>c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(153) : error C2059: syntax error : ')'
1>c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(153) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(159) : warning C4522: 'CMessage' : multiple assignment operators specified
1>c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(159) : warning C4521: 'CMessage' : multiple copy constructors specified
1>c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(114) : error C2593: 'operator =' is ambiguous
1> c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(73): could be 'CText &CText::operator =(CText)'
1> c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(55): or 'CText &CText::operator =(const CText &)'
1> while trying to match the argument list '(CText, CText)'
1>c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(125) : error C2593: 'operator =' is ambiguous
1> c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(73): could be 'CText &CText::operator =(CText)'
1> c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(55): or 'CText &CText::operator =(const CText &)'
1> while trying to match the argument list '(CText, const CText)'
1>c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(142) : error C2593: 'operator =' is ambiguous
1> c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(73): could be 'CText &CText::operator =(CText)'
1> c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(55): or 'CText &CText::operator =(const CText &)'
1> while trying to match the argument list '(CText, CText)'
1>c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(149) : error C2593: 'operator =' is ambiguous
1> c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(73): could be 'CText &CText::operator =(CText)'
1> c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(55): or 'CText &CText::operator =(const CText &)'
1> while trying to match the argument list '(CText, const CText)'
1>c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(167) : error C2668: 'CMessage::CMessage' : ambiguous call to overloaded function
1> c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(153): could be 'CMessage::CMessage(CMessage)'
1> c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(146): or 'CMessage::CMessage(const CMessage &)'
1> while trying to match the argument list '(CMessage)'
1>c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(172) : error C2593: 'operator =' is ambiguous
1> c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(130): could be 'CMessage &CMessage::operator =(CMessage)'
1> c:\documents and settings\qun.mei\desktop\vc2010_code\ch08\ex8_09.c pp(119): or 'CMessage &CMessage::operator =(const CMessage &)'
1> while trying to match the argument list '(CMessage, CMessage)'
1>Build log was saved at "file://\\oaknnetapp2\home\qun.mei\My Documents\Visual Studio 2008\Projects\Ex8\Ex8\Debug\BuildLog.htm"
1>Ex8 - 24 error(s), 4 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

The file is downloaded from the book web site and is exactly same as the book shows. I could not figure out where it went wrong. Thank you for your help.
 
Old April 23rd, 2011, 12:23 AM
Registered User
 
Join Date: Apr 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

did u put this in errata? maybe its because u used the 2008 version, this book is the 2010 version. Try compiling it using the 2010 version. Hope this helps!





Similar Threads
Thread Thread Starter Forum Replies Last Post
frame.cpp lars69 BOOK: Ivor Horton's Beginning Visual C++ 2008 ISBN: 978-0-470-22590-5 0 October 14th, 2009 05:36 AM
Problem Ex8_09 bug?? GeorgeSnead BOOK: Ivor Horton's Beginning Visual C++ 2008 ISBN: 978-0-470-22590-5 9 February 4th, 2009 04:17 AM
Ex6_02.cpp spareparts BOOK: Ivor Horton's Beginning Visual C++ 2005 1 February 19th, 2008 07:15 PM
visual cpp tanay Visual C++ 0 May 19th, 2005 08:00 AM
visual cpp tanay Visual C++ 0 May 19th, 2005 07:47 AM





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