Explore compiler code

With the Compiler Explorer, you can enter code to explore the capabilities of your compilers and interpreters. Qt Creator supports all languages, compilers, and libraries that Compiler Explorer supports. You can save your compiler explorer session as a JSON-based .qtce file.

{Python code in the compiler explorer}

Note: Enable the Compiler Explorer plugin to use it.

To check how a compiler sees C++ or Python code:

  1. Select Tools > Compiler Explorer > Open Compiler Explorer.
  2. In the Language field, select the language to compile.
  3. In the Compiler field, select a compiler to see the assembly code.
  4. Enter code to see the resulting assembly code.

You can also see the application status and output.

To explore several compilers, select Add Compiler.

Set compiler options

Select to set options for the selected compiler.

{Compiler Explorer options}

SettingValue
Compiler optionsArguments passed to the compiler. Add options to enable optimization and to change other aspects of the compilation. For example, the value -O3 enables the optimizer with aggressive optimization.
LibrariesSelect Edit to add the libraries that your code links against. Start typing in the field to find a particular library. The selection is saved only after you select the version of the library next to the library name.
Execute the codeExecute the resulting executable.
Compile to binary objectConvert the source code to a binary executable.
Intel asm syntaxUse the Intel ASM syntax for writing the assembly code.
Demangle identifiersExtract and demangle identifiers from mangled symbols. Name mangling adds descriptive data to a function's identifier at link time. The data indicates which namespace and object a function belongs to and which arguments it handles in which order.

See also Create compiler explorer sessions, Enable and disable plugins, Add compilers, and Add custom compilers.

© 2023 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.