CLion 2022.3 EAP: Compile and Run for Single Files and a New UI
A new CLion 2022.3 EAP build is available!
Download build 223.7401.10 from our website, via the Toolbox App, or as a snap package (if you are using Ubuntu). Update via patch if you are using the previous EAP build.
Option to run single files
If you have a CMake or Makefile project, opening it in CLion is quite straightforward; you just point the IDE to the top-level directory or top-level CMakeLists.txt or Makefile file and select the option to open it as a project. CLion loads the project model and extracts the compilation flags from it in order to correctly parse, build, and run the code. However, if you are just getting started with the C or C++ language, you may have just one or two C++ files that you write code in and then want to compile and run. The concept of the project model might seem too complex and redundant for you in this case.
We want to assist developers who are starting to learn C and C++, so we decided to implement a flow that will simplify project configuration and setup in CLion. The option to compile and run a single C or C++ file in CLion is our first step towards this goal.
Let’s open a C++ file via the Open action in the Welcome wizard (you can also open a folder with one or several C++ files in it via the same action):
As you can see, we don’t have a project model. However, notice the run icon in the left gutter that allows you to run or debug the current file.
If you now click Run there, a Run/Debug configuration of a new type (C/C++ File) will be created for you automatically. This configuration allows you to quickly configure the toolchain, source files, and compilation options. You can also create this configuration manually via Add New Configuration:
When created, it allows you to compile and run the selected files. As my file requires the C++20 standard to compile, I need to add this option to the default configuration:
Now I can compile and run my file in CLion:
I can also debug my file. CLion will automatically add the required compiler flags for generating debug information (i.e.
-g for GCC and Clang, or similar options for MSVC), so no changes in the configuration are required.
Important notes and known issues
- If you open a single C/C++ file in CLion and create a C/C++ File configuration, it will be stored in the temporary directory. After your system restart these directories are removed.
- If you open a folder with one or several C++ files in CLion and create a C/C++ File configuration, the information will be stored in the .idea directory inside your folder. You can re-open this folder later and get all your configurations working.
In the Run C/C++ File configuration, the Default toolchain is preselected, but you can change it to another one. Note that CLion uses cc and c++ compilers on macOS and Linux and cl.exe on Windows by default. To change that you can use Additional options | Compiler path field in the run/debug configuration. Docker and remote toolchains are not supported.
Do you think this feature will be useful to you? Give it a try and let us know what you think.
New CLion UI available via a setting
Earlier this year, we started a preview of the new UI for our IntelliJ-based IDEs. The main goals of the UI change were to reduce visual complexity, provide easy access to essential features, and progressively disclose complex functionality as needed. The key changes in the new UI are:
- Simplified main toolbar
- New tool windows layout.
- New Light and Dark color themes.
- Updated icon set.
This resulted in a look and feel that we believe is clean, modern, and powerful. Given the millions of current users of our IntelliJ-based IDEs, we want the rollout process for the new UI to be gradual and feedback-driven.
In CLion, we spent some extra time polishing C and C++ specific tool windows and features so they would work smoothly in the new UI. Today we are ready to announce that the new UI is available in CLion!
We invite you to switch to it in Settings/Preferences | Preferences | Appearance & Behavior | New UI. Give it a test drive and share your thoughts about this huge change with us.
You should also feel free to check out the recording of the webinar about the new UI recently held by our IntelliJ Platform team – New UI: A Glimpse at the Future.
The full release notes are available here.
A reminder about what has already been delivered in the CLion 2022.3 EAP:
- CMake debugger
- Enhanced CMake integration
- Built-in documentation for Clang-Tidy checks
- Ability to open documentation at cppreference.com
- Function return values in the debugger
- Azure RTOS thread view
- Syntax support for linker scripts
- New solution for settings synchronization
- Support for C++20 Modules
Download the latest EAP build to give the new features and enhancements a try, and be sure to share your feedback with us! EAP builds are free to use.
Your CLion team
The Drive to Develop
Subscribe to Blog updates
CLion Nova – Final Update
CLion Nova is a free preview version of CLion equipped with the ReSharper C++/Rider C++ language engine. We started it as a stand-alone preview in November 2023, and since then we’ve received tons of positive and inspiring feedback. Based on that feedback, we’ve added a setting to the recent CLion C…
CLion 2024.1 EAP 4: Switch to CLion Nova in CLion Classic
The CLion 2024.1 EAP 4 build (241.13688.39) is out! It is available from our website, via the Toolbox App, or as a snap package if you’re using Ubuntu. With this build, we’re making CLion Nova available to all CLion Classic users. Switch to it from inside the IDE via the settings menu and try it …
CLion 2024.1 EAP 3: Assembly View Enhancements
Today, the CLion 2024.1 EAP 3 build (241.12662.59) is available from our website, via the Toolbox App, or as a snap package if you’re using Ubuntu. Here are the main improvements: Assembly view improvements: The Assembly view for ARM targets is now shown correctly (CPP-36901). Assembly vi…
CLion 2024.1 EAP 2: Improved Terminal and Other UX Enhancements
Some time ago, we shared our plans and directions. Just a couple of weeks ago, we kicked off our CLion 2024.1 EAP with CMake coding assistance, code analysis in device tree files, and forked processes debugging. Today, the CLion 2024.1 EAP 2 build (241.11761.23) is available from our website, via…