Managed C++ Error 2504 Error
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
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()
{
}
Fixed it... Forgot public before Auction so it was defaulting to private inheritance... Doh!
精彩评论