-
MANY MANY error messages
Why is it that I add in a piece of code in its own files sometimes I end up with HUNDREDS of errors throughout all the code. It ranges from connected code to completely un related code sections. For example I just put in some code for a database access and I got 332 errors. Some of it related to the database sections and look completly correct as in within the database.h file(referenced in stdAfx.h) I call
Code:
#import "c:\Program Files\Common Files\System\ADO\msado15.dll" \
rename("EOF", "EndOfFile")
typedef ADODB::_RecordsetPtr RecPtr;
typedef ADODB::_ConnectionPtr CnnPtr;
and in the database.cpp file I try
Code:
#include "stdAfx.h"
ADODB::_RecordsetPtr rec1=NULL;
and the first three errors I get are
Code:
c:\documents and settings\administrator\my documents\my projects\dosage\database.cpp(3) : error C2146: syntax error : missing ';' before identifier 'rec1'
c:\documents and settings\administrator\my documents\my projects\dosage\database.cpp(3) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\documents and settings\administrator\my documents\my projects\dosage\database.cpp(3) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
AT the same time I also get errors in the splash.cpp and splash.h files which were working perfectly prior to me adding the database.
What could be wrong? What would cause all these errors all over other wise correct code?
-
Perhaps it doesn't know what ADODB::_RecordsetPtr is when compiling dabatase.cpp. Is the header that declares that included in your stdafx.h?
-
What I see in the sample http://support.microsoft.com/kb/169496
and don't see in your code -
Code:
#include <afxdao.h> // MFC DAO
// -or-
#include <dbdao.h> // DAO SDK
before import