QMAKE_CFLAGS += -std=c99 //Qt中加入此句及可支持C99语言
use option -std=c99 or -std=gnu99 to compile your code
QT中有
TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
QMAKE_CFLAGS += -std=c99
SOURCES += main.c
C:\Documents and Settings\Administrator\test_1\main.c:14: error: 'for' loop initial declarations are only allowed in C99 mode
C:\Documents and Settings\Administrator\test_1\main.c:14: use option -std=c99 or -std=gnu99 to compile your code
解决方法:在工程的.pro中添加 QMAKE_CFLAGS += -std=c99 然后重新编译即可!
阅读(1857) | 评论(0) | 转发(0) |