这是我的 C++ CLI 代码:
public ref class SVeh{
public:
bool Is( Pla^ For);
};
Pla
定义在 SVeh
之后。
public ref class Pla{
public:
bool somemethod();
};
编译器将 Pla
类作为未知标识符,并且不会对其进行编译。
如何解决这个问题?
最佳答案
我不懂C++/CLI,但如果它类似于C++,你可以转发声明Pla:
ref class Pla;
public ref class SVeh{
// rest of code
参见 this question获取更多信息。
关于c++ - 如何拥有在当前类之后定义的类的变量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15428388/