Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) Compiler

 

A compiler is a program that translates your C++ code to object code, after which it is linked (by the linker) to an executable.

 

A compiler might emit compile warnings and compile errors.

 

Compile cleanly at high warning levels [1,3]. Prefer compile errors to runtime errors [2].

 

 

 

 

 

Qt Creator How to use Qt Creator to compile C code?

 

In the project file, add the following lines:

 

QMAKE_CXX = gcc
QMAKE_CXXFLAGS = -x c

 

 

 

 

 

Qt Creator How to set the C compiler to the C99 standard in Qt Creator?

 

In the project file, add the following lines:

 

QMAKE_C = gcc
QMAKE_CFLAGS = -x c -std=c99

 

 

 

 

 

External links

 

 

 

 

 

 

References

 

  1. Herb Sutter, Andrei Alexandrescu. C++ coding standards: 101 rules, guidelines, and best practices. ISBN: 0-32-111358-6. Item 1: 'Compile cleanly at high warning levels'.
  2. Herb Sutter, Andrei Alexandrescu. C++ coding standards: 101 rules, guidelines, and best practices. ISBN: 0-32-111358-6. Item 14: 'Prefer compile- and link-time errors to run-time errors'.
  3. Linus Torvalds. Re:[PATCH] Don't compare unsigned variable for <0 in sys_prctl(). 2006-11-28. Retrieved on 2010-09-20. 'Friends don't let friends use [gcc] "-W"'

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict