我是靠谱客的博主 感动小馒头,这篇文章主要介绍QT 入门,现在分享给大家,希望可以做个参考。

1. QT helloworld 不支持C 仅支持C++

如果是C语言,编译会出现如下错误

/usr/include/qt4/QtCore/qbytearray.h:588:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘&’ token
/usr/include/qt4/QtCore/qbytearray.h:590:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘&’ token
/usr/include/qt4/QtCore/qbytearray.h:592:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘&’ token
/usr/include/qt4/QtCore/qbytearray.h:597:1: error: unknown type name ‘Q_CORE_EXPORT’
/usr/include/qt4/QtCore/qbytearray.h:597:27: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘&’ token
/usr/include/qt4/QtCore/qbytearray.h:598:1: error: unknown type name ‘Q_CORE_EXPORT’
/usr/include/qt4/QtCore/qbytearray.h:598:27: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘&’ token
/usr/include/qt4/QtCore/qbytearray.h:602:1: error: unknown type name ‘Q_CORE_EXPORT’
/usr/include/qt4/QtCore/qbytearray.h:602:26: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘qCompress’
/usr/include/qt4/QtCore/qbytearray.h:603:1: error: unknown type name ‘Q_CORE_EXPORT’
/usr/include/qt4/QtCore/qbytearray.h:603:26: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘qUncompress’
/usr/include/qt4/QtCore/qbytearray.h:604:1: error: unknown type name ‘QByteArray’
/usr/include/qt4/QtCore/qbytearray.h:604:35: warning: type defaults to ‘int’ in declaration of ‘QByteArray’ [-Wimplicit-int]
/usr/include/qt4/QtCore/qbytearray.h:604:45: error: expected ‘;’, ‘,’ or ‘)’ before ‘&’ token
/usr/include/qt4/QtCore/qbytearray.h:606:1: error: unknown type name ‘QByteArray’
/usr/include/qt4/QtCore/qbytearray.h:606:37: warning: type defaults to ‘int’ in declaration of ‘QByteArray’ [-Wimplicit-int]
/usr/include/qt4/QtCore/qbytearray.h:606:47: error: expected ‘;’, ‘,’ or ‘)’ before ‘&’ token
/usr/include/qt4/QtCore/qbytearray.h:610:1: error: expected declaration specifiers before ‘Q_DECLARE_TYPEINFO’
/usr/include/qt4/QtCore/qbytearray.h:611:1: error: expected declaration specifiers before ‘Q_DECLARE_SHARED’
In file included from /usr/include/qt4/QtCore/qobject.h:48:0,
                 from /usr/include/qt4/QtCore/qcoreapplication.h:45,
                 from /usr/include/qt4/QtGui/qapplication.h:45,
                 from /usr/include/qt4/QtGui/QApplication:1,
                 from hello_qt.c:1:
/usr/include/qt4/QtCore/qstring.h:54:20: fatal error: string: No such file or directory


最后

以上就是感动小馒头最近收集整理的关于QT 入门的全部内容,更多相关QT内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(62)

评论列表共有 0 条评论

立即
投稿
返回
顶部