下面的代码使用给了我:不完全型嵌套命名空间
In member function ‘void A::method()’:error: incomplete type ‘B’ used in nested name specifier B::meth();
我寻找解决这个错误的SO发现,我可以用::
但没有帮助
class B;
class A
{
public:
void method()
{
B::meth();
}
};
class B
{
public:
void static meth()
{
}
};
你有没有试过在A班之前定义B班? –
我有,但后来我有其他依赖问题,有没有其他解决方案? – lllook
看看@R Sahu的答案,希望它有帮助。 –