How to use Qt Creator to compile C code? is a Qt FAQ how to use Qt Creator to compile C code.
Add the following lines to your Qt project file:
Qt project file: CppCompilerC.pro
QT -= core gui #Compile with Gnu C compiler QMAKE_CXX = gcc QMAKE_CXXFLAGS = -x c TARGET = CppCompilerC CONFIG += console CONFIG -= app_bundle TEMPLATE = app SOURCES += main.cpp
///C code that is invalid C++ code struct template { int new; struct template* class; }; int main() { struct template t; t.new += 1; t.class = 0; return 0; }