Qt编译出现:which is of non-class type... P:主要是dialog是指针, 但是引用其成员的时候使用了".", 把它当作一般的变量使用了, 这样就会导致这个编译错误. S: dialog->show();即可解决错误
a是指针,不能用a. 要用a->
p=l.next; 应该改为l->next;因为Link被定义为指针类型,即l为一个指针,指针类型需要解引用调用其成员。
int main(){ Cat my_cat; //去掉括号就好 cout<<"I have a cat called \""<<my_cat.getname()<<"\"."<<endl;//出现错误的地方 }
问题三 request for member which is of non-class type 首先上别的同学的解释 这个样例代码里面掺了一点template 清晰的解释 其实看到上面的这些我大概知道在说什么但是完全不知道怎么下手,可能是当时代码也有别的错误所以改了还是跑不出来,然后我看了篇构造函数的一些小问题,发现是我的main函数里面在使用无参的默认...
requestformember'first'in'pair',which is of non-classtype'std::pair<Key, Key>(Key (*)(), Key (*)())' 按照[1]的说法,这是把Key()当函数用了。 当然这样改也是可以的,就不用std::make_pair了。 voidtest_pair(){Key key1;Key key2;std::pair<Key,Key>pair(key1,key2);pair....
request for member "..." in "..." which is of non-class type "..." D:\debug\qt\6\main.cpp:15: error: request for member 'exec' in 'a', which is of non-class type 'QCoreApplication(int, char)' return a.exec(); 删掉参数类型...
在使用QFont类时,报错Qt error: request for member 'setPixelSize' in 'font', which is of non-class type 'QFont()'。 原因 错误提示的意思是试图在一个非类类型的对象font上调用setPixelSize方法,但QFont()是一个函数,不是一个类的实例。
carea rect2();错了,默认构造函数的调用方法是:carea rect2;上面那种写法会被当成函数声明,所以不会报错,但是不可以这么用
Request for member which is of non-class type 'char'. line 10: docnur has a char data member called dn line 14: an object called dn is instantiated line 55: the dadd function is called within itself dn.dadd(); It sounds like there's confusion with the same name being used for diff...