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


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值