CLion answers frequently asked questions
We’ve gathered a list of Frequently Asked Questions and would like to share the answers, workarounds and tips with you.
Q: Should I use CMake to try CLion?
A: Yes. CLion supports only CMake-based projects for now.
But you can try importing non-CMake project into CLion using Import Project functionality.
Q: Do you plan to support any other build systems? When is this going to happen?
A: Yes, this is in our plans. Please find the feature request in our tracker to vote and comment on. CLion 1.0 will definitely come with CMake support only, but later we’ll decide where to move next, by considering your votes in the tracker. The most popular options so far are:
Feel free to vote and leave comments in these requests so we can better understand your needs.
- Cygwin: Get the latest available 64-bit version and make sure to select gcc/g++, cmake, make and gdb 7.8 while installing the packages.
- MinGW: CLion currently supports MinGW and MinGW-w64. See the compatible versions list in our quick start guide.
In addition, don’t forget to install make and gcc/g++ packages from MinGW toolchain to make it work with CLion.
- Microsoft Visual C++ compiler is available starting with v2017.1 via CMake (with NMake generator). Check more details
Q: Can I change the toolchain from what I’ve selected on the Welcome screen?
A: Sure. Feel free to change it in Preferences/Settings | Build, Execution, Deployment | Toolchains. Try checking the environment functionality there to understand if anything is missing or wrong with your toolchain. It will try to build a very simple program and inform you of the result.
Q: What compilers can I use? How do I change the compiler?
A: At present CLion supports GCC and Clang compilers, MSVC is available in the experimental mode and is guided by these two to get the libraries and headers paths. In the next releases we are planning to extend the list of compilers available in CLion.
Since CLion relies on CMake build system. To change the compiler used in CLion, use method #2 from the official CMake documentation.
Go to Preferences/Settings | Build, Execution, Deployment | CMake | CMake options and pass the following commands:
The corresponding CMake cache variables will be overwritten.
Q: How to pass environment variables and parameters to CMake in CLion?
A: The best way is to use Preferences/Settings | Build, Execution, Deployment | CMake dialog.
Q: CLion builds my project in some IDE’s directory? How to change that?
A: This can be done easily with CMake variables. Just set:
You can change build output directory in Preferences/Settings | Build, Execution, Deployment | CMake dialog as well.
In addition, the Run/Debug Configurations dialog (Run | Edit Configurations…) in CLion allows you to set program execution arguments, working directory, and environment variables.
Q: CLion fails to find some of my headers. Where does it search for them?
A: CLion searches through the same places CMake does. Set the
INCLUDE_DIRECTORIES variable in CMake to provide the headers path to the IDE.
By the way, in this wiki you can find a lot of useful CMake variables with descriptions that can be especially helpful if you are new to CMake.
Q: Refactorings are not working and highlighting is wrong, even though the project can be compiled correctly. What’s happened?
A: Most probably CLion is unaware of some files in your project (these files are grayed out in the project tree):
It gets this information from the CMakeLists.txt files in the following way:
This is how CLion now knows that main.cpp is included in your project. As for now, header files (in case their names differ from the appropriate .cpp files already added to the
SOURCE_FILES variable) should also be included in the project in that way.
Keymaps, useful shortcuts
Q: I prefer Visual Studio / Xcode / etc. keymap. How do I use it in CLion?
A: CLion supports a variety of keymaps. Choose and use your favorite one, or create a new keymap based on an existing one. Go to Preferences/Settings | Appearance and Behavior | Keymap to manage keymaps, or just press
Ctrl+` to quickly switch the scheme.
Q: A shortcut is not working for me. What should I do?
A: Before reporting the error to our tracker, rule out the following possibilities:
- The CLion shortcut conflicts with some system shortcut, and pressing it in the IDE does something different from the expected behaviour.
- You are trying a shortcut that differs from the current keymap set.
If none of these apply, please report the issue to our tracker.
By the way, the top 10 actions & default keymap shortcuts for these actions, from our point of view, are:
Alt+Enteron all platforms: Shows intention actions and quick-fixes.
- Smart completion:
Ctrl+Shift+Spaceon all platforms: Offers more accurate completion suggestions than basic completion, by filtering the list of methods and variables to match the expression type.
- Refactor this:
Ctrl+Ton all platforms: Shows the list of refactorings available in the current scope.
- Parameter info:
Cmd+Pon OS X,
Ctrl+Pon Windows/Linux: Shows the method call’s arguments with types:
- Go to Related Symbol:
Ctrl+Cmd+Upfor OS X,
Ctrl+Alt+Home: Helps you to quickly navigate between .h and .cpp files, and more.
- Generate code:
Cmd+Non OS X,
Alt+Inserton Windows/Linux: Suggests code generation options for you.
- Surround With:
Cmd+Alt+Ton OS X,
Ctrl+Alt+Ton Windows/Linux: Helps you generate surrounding blocks of code like
- Find usages:
Alt+F7on all platforms: Finds code and non-code usages of the selected word.
- File structure:
Cmd+F12for OS X,
Ctrl+F12: Helps you navigate through the file structure:
- Find action:
Shift+Cmd+Aon OS X,
Ctrl+Shift+Aon Windows/Linux: Searches for actions by their names; especially useful when you don’t know the full action name.
Q: Typing/completion/etc. is slow.
A: To help us figure out why this is happening, we will need some additional information from you. Please send us a sample project, if possible, and a CPU snapshot, as described here.
Q: Is CLion a paid product? Is this functionality available as a plugin for IntelliJ IDEA?
A: CLion is a commercial product built on our own open-source IntelliJ Platform. As all other JetBrains products, CLion will most likely have a variety of licensing options, including free and paid ones. For an example, see our AppCode buy page.
We are not planning a plugin option for IntelliJ IDEA until CLion 1.0 release, but this possibility will be considered later.
Q: Is it possible to write plugins for CLion?
A: Yes, as all other JetBrains IntelliJ-Platform-based products, CLion is open to plugin development. Find useful information in our confluence space. Still, before v1.0 the API may be unstable and plugins may be broken occasionally.
Find more information on our support page.