Results 1 to 7 of 7

Thread: Compiling error C2504: Base class undefined

  1. #1
    Join Date
    Jun 2011
    Posts
    57

    Compiling error C2504: Base class undefined

    Hi, I am have develop a code in the VC++ .Net and I think I have written everything perfectly as I know, but still while compiling the program I am getting different errors, in fact I just get rid out of all others but the one that’s C2504: Base class undefined, this is the one that I am not getting, from where it is coming, I have checked all the code properly, but didn’t find solution, but I think something is missing in the program isn’t it? Any suggestion?

  2. #2
    Join Date
    Apr 2009
    Posts
    569

    Re: Compiling error C2504: Base class undefined

    Yeah off course I would say the same as the error itself says that the base class is not defined so I think you should check first of all the class that you have made in the program and I am sure that some of the child class doesn’t have any base class for that so I would suggest you that you should first of all check whether all the classes and their members are perfectly defined and then compile it again.

  3. #3
    Join Date
    May 2009
    Posts
    539

    Re: Compiling error C2504: Base class undefined

    let me tell you first that the base class is always declared not defined, and according to me the possible causes would be like missing include files, or you might have declare that External base with Extern, that you cannot do.
    See this is the basic sample from that you can understand :


    Code:
    class ABC;
    class BCD : public ABC
    {   
    	// C2504, you must have to declare ABC to use it as a base class
    };
    
    int main()
    {
    }

  4. #4
    Join Date
    Apr 2009
    Posts
    488

    Re: Compiling error C2504: Base class undefined

    I would like to suggest you that, to all the class that you have mentioned, check all the visibility scope for each class because though you have defined the perfect base class but due to its scope it won’t be accessed outside, so check whether you have putted perfect visibility scope for all the classes, and off course check the spelling of all the defined members and the procedure in the program, because it always been same in both the side like at the declaration and at the calling function.

  5. #5
    Join Date
    May 2009
    Posts
    527

    Re: Compiling error C2504: Base class undefined

    See this might be possible that The ESRI libraries are not referenced in the right series. And because of that only you must be getting this error, this kind of problem happens because a variety of ESRI kind libraries are reliant upon other native files, and If they are not referenced in the accurate arrange, errors may happened. I would say you should straightforwardly locate the SDK_Windows.h file in source code, this may help you.

  6. #6
    Join Date
    May 2009
    Posts
    511

    Re: Compiling error C2504: Base class undefined

    have you include all the library files in your source code? I mean to say as the above user havs mentioned about the Windows.H file which is needed ff course so for that you must include #include <windows.h> in the library declaration along with others. And according to me one more ordinary reason of this trouble is having equally comprehensive header files,

    Follow this example

    Code:
    [rectangle.h]
    #include "TraceObject.h"
    .
    .
    .
    .
    [TraceObject.h]
    #include "rectangle.h"

  7. #7
    Join Date
    May 2009
    Posts
    637

    Re: Compiling error C2504: Base class undefined

    Hey thanks guys for your attention towards this thread and though it was too helpful, I would say after reading all the comments actually I forced myself to check all the file again, and really this is was the mistakes in the include files only, actually I haven’t mentioned them properly, and after declaring those files the program run with no other error. So just want to say thanks to all the user who has replied to this thread.

Similar Threads

  1. Using sizeof () class with empty base class in GCC
    By Alfiee in forum Software Development
    Replies: 6
    Last Post: 27-06-2011, 10:31 AM
  2. Event handlers vs. base class method overrides
    By Tailapa in forum Software Development
    Replies: 5
    Last Post: 26-06-2011, 07:38 PM
  3. Replies: 4
    Last Post: 08-01-2011, 07:52 AM
  4. What is Visual base class in C++?
    By Venugopala in forum Software Development
    Replies: 4
    Last Post: 28-12-2010, 08:11 AM
  5. Replies: 5
    Last Post: 12-02-2010, 06:23 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,715,305,221.58461 seconds with 17 queries