开发者

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!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜