Take the 2-minute tour ×

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.


share|improve this question

2 Answers 2

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()
share|improve this answer
up vote 0 down vote accepted

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

share|improve this answer

Your Answer


