Only have Visual Studio 2008 about a week but just ran into something inexplicable to me. This include file (and others like it)...

//DoTestData.h
#ifndef DOTESTDATA_H
#define DOTESTDATA_H

unsigned int iCreateDB(TCHAR*);
unsigned int blnMakeTable(SQL&);   
int GetRecordCount(SQL&, unsigned int&);
unsigned int blnInsert(SQL&, TCHAR**, unsigned int&, HWND, int);
unsigned int blnDumpData(SQL&, TCHAR**, unsigned int&, HWND);
void btnAccess_OnClick(lpWndEventArgs);
void btnSqlServerExpress_OnClick(lpWndEventArgs); 
void btnSqlServerMSDE_OnClick(lpWndEventArgs);
 
#endif

...generate this error...

c:\code\vstudio\vc++9\sqldemo\DoTestData.h(5) :
error C2144: syntax error : 'unsigned int' should be preceded by ';'

Why in the world should I have to place a semicolon before a line? At a total loss as to why I would have to place a semicolon before a line but wanting the darn thing to compile I thought, "Well, its ridiculous, but if it wants one before the line I'll put it there and see what happens!" Sure enough, it compiled! (Runs too). Here is the changed code with a semicolon before the 'unsigned int'. What in the world is going on???

//DoTestData.h
#ifndef DOTESTDATA_H
#define DOTESTDATA_H

;unsigned int iCreateDB(TCHAR*);
unsigned int blnMakeTable(SQL&);   
int GetRecordCount(SQL&, unsigned int&);
unsigned int blnInsert(SQL&, TCHAR**, unsigned int&, HWND, int);
unsigned int blnDumpData(SQL&, TCHAR**, unsigned int&, HWND);
void btnAccess_OnClick(lpWndEventArgs);
void btnSqlServerExpress_OnClick(lpWndEventArgs); 
void btnSqlServerMSDE_OnClick(lpWndEventArgs);
 
#endif

You've got

#include "somethingElse.h"
#include "DoTestData.h"

The last thing in somethingElse.h is the real cause of the problem, and it will be missing the ; in question.

Comments
Logic prevails!
Nice.

Are you including other header file that has classes?

If so then the class is probably missing a semicolon at the end of
its definition.

class A
{ ... 
} ; <--- need semi-colon?

If you do not have class defined in other header file, then something is missing a semi-colon.

Thanks Salem & firstPerson. That was it. I copied the 1st line of a procedure in a .cpp file to a .h file for a prototype, and forgot to put a semicolon at the end.

This question has already been answered. Start a new discussion instead.