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 入门)