tags:

views:

27

answers:

3

I'm new to managed c++ and I'm attempting to design a program for a presentation. I am attempting to have a class inherit from an ABC and I'm getting the Error C2504. The code in question is as follows:

ref class Item : Auction //Error C2504 here {

//More code for the class Auction is defined in a different .h file.

Let me know if there are any other questions or if you need to see more of the code.

Thanks

A: 

Auction hasn't been defined at that point, at a guess you're not including it in the file where you're seeing the error (or it's header file).

From http://msdn.microsoft.com/en-us/library/dw443zc0(VS.71).aspx

// C2504.cpp
class A;
class B : public A
{   // C2504, define A before using it as a base class
};

int main()
{
}
Binary Worrier
A: 

Ya I saw msdn's address to it, but it didn't make sense. I've tried declaring the Auction class within the same file but I still had the same error

Major
A: 

Fixed it... Forgot public before Auction so it was defaulting to private inheritance... Doh!

Major