我是靠谱客的博主 感动小馒头,最近开发中收集的这篇文章主要介绍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 入门所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

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

评论列表共有 0 条评论

立即
投稿
返回
顶部