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 September 22nd, 2003, 02:49 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: McPherson, Kansas, USA.
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default Need Help: Can't determine cause of error

This is the error message I am receiving from the compiler.

error C2146: syntax error : missing ';' before identifier 'ScheduleDB'
fatal error C1004: unexpected end of file found

This is the line of code the error points to.

extern UINT m_SysMode;
extern CDBTools ScheduleDB;

I also get this error when I try to declare the object within the Document class object.

What I am trying to do is create a global object of type CDBTools. Seems easy enough but guess again.

Any help would be greatly appreciated.

Thanks in advance.

Larry Asher
__________________
Larry Asher
 
Old September 22nd, 2003, 03:06 PM
Authorized User
 
Join Date: Aug 2003
Location: Cary, NC, USA.
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Usually I have seen this error when I have declared a class in the header file and have somehow deleted the semi-colon at the end of the class definition.

class CProjectTreeView : public CTreeView
{
protected:
    CProjectTreeView();
    DECLARE_DYNCREATE(CProjectTreeView)
...
};

 
Old September 22nd, 2003, 04:16 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: McPherson, Kansas, USA.
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I appreciate the quick response and that was one of the first things I checked. Evidently, it had something to with having the source code in the header file. I was able to change that successfully. However, when separating the source code from the header file for another class I now receive the following error: And again I am stumped?

unexpected end of file while looking for precompiled header directive

Thanks again.

Larry Asher
 
Old September 22nd, 2003, 05:00 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: McPherson, Kansas, USA.
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This seemed to be the problem. I did not have stdafx.h declare at the begining of the source file, which refereneced MFC classes.

C1010: unexpected end of file while looking for precompiled header directive

If your project is an MFC AppWizard created project then this error results from not #including StdAfx.h as the first #include statement (before any other #includes, data declarations, or executable program code).

Thanks to all.

Larry Asher




Similar Threads
Thread Thread Starter Forum Replies Last Post
Determine if numeric Scootterp Access VBA 4 March 2nd, 2006 08:44 AM
Determine Credentials bmumph C# 2 November 1st, 2005 12:18 PM
Error while trying to determine state of checkbox savoym C# 2 February 19th, 2004 09:36 AM
Determine OS adman Beginning VB 6 2 January 5th, 2004 02:26 AM
Determine if something has already been selected harpua Classic ASP Basics 1 June 13th, 2003 01:02 AM





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