Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > Visual C++
| 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 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 April 26th, 2006, 03:06 AM
Authorized User
 
Join Date: Apr 2006
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Compilation error when declare class

hai,

I am a new to embedded visual C++. I have installed embedded visual C++ 4.0 and WinCE standard sdk 420 to do testing.

I have created a class call CPerson and add serialize function into into this class. Ihave no problem on creating and compiling this class.

But when I try to use this class as below in Document Class

SerializeDoc.h
-------------------
private:
CPerson* AddNewRecord();

SerializeDoc.cpp
-------------------
CPerson* CSerializeDoc::AddNewRecord()
{
CPerson *pPerson = new CPerson();
return pPerson;
}

when I build this after inserting this code, it give me these errors:

C:\Documents and Settings\user1\My Documents\Serialize\SerializeDoc.h(51) : error C2143: syntax error : missing ';' before '*'
C:\Documents and Settings\user1\My Documents\Serialize\SerializeDoc.h(51) : error C2501: 'CPerson' : missing storage-class or type specifiers
C:\Documents and Settings\user1\My Documents\Serialize\SerializeDoc.h(51) : error C2501: 'AddNewRecord' : missing storage-class or type specifiers

This thing already stuck me few days, can some one pls help.

Thanks in advance.

Regards.





Similar Threads
Thread Thread Starter Forum Replies Last Post
dynamic compilation of class based on xsd vhrao .NET Framework 3.5 0 July 7th, 2008 03:53 PM
DataGridView Error Must declare the scalar var. program2be BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 1 February 11th, 2007 04:39 PM
DataGridView Error Must Declare Scalar Var. program2be Visual Basic 2005 Basics 1 January 29th, 2007 11:08 PM
compilation error pratik28 C# 1 September 24th, 2006 07:39 AM
Compilation error when declare class bluebeta Visual C++ 0 April 26th, 2006 03:11 AM





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