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.
Note: Enable the Compiler Explorer plugin to use it.
To check how a compiler sees C++ or Python code:
- Go to Tools > Compiler Explorer > Open Compiler Explorer.
- In Language, select the language to compile.
- In Compiler, select a compiler to see the assembly code.
- Enter code to see the resulting assembly code.
Hover the mouse over the assembly code, to have the matching source lines highlighted.
You can also see the application status and output.
To explore several compilers, select Add Compiler.
Set compiler options
Select next to the Compiler field to set options for the selected compiler.
Setting | Value |
---|---|
Compiler options | Arguments 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. |
Libraries | Select 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 code | Execute the resulting executable. |
Compile to binary object | Convert the source code to a binary executable. |
Intel asm syntax | Use the Intel ASM syntax for writing the assembly code. |
Demangle identifiers | Extract 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. |
Change the server URL
To use Compiler Explorer at another URL:
- Select next to Powered by.
- In URL, enter the address of the Compiler Explorer to use.
See also Create compiler explorer sessions, Enable and disable plugins, Add compilers, and Add custom compilers.
Copyright © The Qt Company Ltd. and other contributors. 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.