QT编译错误

来源:互联网 发布:win7装linux 编辑:程序博客网 时间:2024/06/07 04:05

错误提示:

main.cpp: In function ‘QWidget* create_first(QWidget*, const char*, uint)’:

main.cpp:5: error: expected type-specifier before ‘hello’
main.cpp:5: error: cannot convert ‘int*’ to ‘QWidget*’ in return
main.cpp:5: error: expected ‘;’ before ‘hello'
main.cpp:5: error: ‘hello’ was not declared in this scope

make: *** [main.o] Error 1

在网上找原因,看到有一篇类似的文章说 ,需要修改setName("hello"),经过几番尝试,最后发现,是因为粗心,没有将QT界面的名字设置成和工程名一样。

0 0