0
点赞
收藏
分享

微信扫一扫

一些编程时的槽点

云上笔记 2022-03-23 阅读 63
linux

新安装Qtcreator时,运行hello world报编译错误

安装qtcreator以后,默认可以新建一个程序,虽然ctrl+R可以运行,但是debug报错:
Qt Creator 工程出现 main.cpp:10:5: error: unknown type name ‘QApplication’

expected a type

expected unqualified-id

main.cpp:2:1: error: expected ‘}’
ostream:42:1: note: to match this ‘{’

main.cpp:7:5: error: use of undeclared identifier ‘cout’

实际已经使用了using namespace std;
需要去:
帮助->关于插件->C++ 去掉Clang Code Model那个勾,然后重启QtCreator

举报

相关推荐

0 条评论