MANY MANY error messages

This is a discussion on MANY MANY error messages within the C++ Programming forums, part of the General Programming Boards category; Why is it that I add in a piece of code in its own files sometimes I end up with ...

  1. #1
    Registered User
    Join Date
    Apr 2007
    Posts
    26

    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?

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    7,340
    Perhaps it doesn't know what ADODB::_RecordsetPtr is when compiling dabatase.cpp. Is the header that declares that included in your stdafx.h?

  3. #3
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    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
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21