Questions tagged [clion]

CLion is a cross-platform IDE for C and C++ development.

CLion is a cross-platform C/C++ IDE from JetBrains (you can run it on Linux, Windows and macOS). It natively supports old and new C/C++ language standards, Boost and libc++ libraries, and works with templated code and macros. CLion helps you instantly navigate and refactor your code, with Rename refactoring, Change Signature, Inline, Extract Function / Variable / Constant / Parameter, and others. Code analysis (including Data Flow Analysis and Clang-Tidy) is running while you are typing to ensure code quality.

CLion uses CMake as a project model and handles your changes in CMake files automatically, using all the information from there during code editing and refactorings.

Apart from CMake, CLion supports compilation database and Gradle projects. Currently, you cannot create a new project of these types within CLion, but you can open and manage an existing one with full code insight available.

CLion will enrich your development with an integrated debugger (GDB and LLDB), Doxygen support, various unit testing frameworks, Version Control Systems, and dozens of plugins from the repository to extend its functionality.

Besides C and C++, CLion comes with Python, HTML, JavaScript, Swift Kotlin/Native and some other languages support included.

CLion’s functionality can be extended via IntelliJ Platform API.

Useful links

2813 questions
168
votes
6 answers

Using local makefile for CLion instead of CMake

Is there a way to configure CLion to use a local makefile to compile code, rather than CMake? I can't seem to find the way to do it from the build options.
hlin117
  • 20,764
  • 31
  • 72
  • 93
92
votes
5 answers

In CLion, header only library: file "does not belong to any project target, code insight features might not work properly"

I have a header-only library project set up with the cmake command: add_library(my_library INTERFACE) and I also added target_sources(my_library INTERFACE ${MY_LIRBARY_HEADER_FILES}) but when I open a source file, I get the warning: This file…
xaxxon
  • 19,189
  • 5
  • 50
  • 80
87
votes
6 answers

How to configure CLion IDE for Qt Framework?

How to configure CLion IDE for Qt Framework? Is this IDE compatible with Qt, or are there other IDEs compatible with Qt? I just want to try to use something else than Qt Creator.
123qwe
  • 1,525
  • 1
  • 14
  • 16
76
votes
4 answers

CLion: Keyboard cmd to switch between header and implementation files like in xcode

In xcode I type cmd-shift up/down to switch between .h and .c files. How do I do that in CLion? Or more usefully, what would that action be called in the keymap? I don't find the keymap names terribly usefully named. None stand out for this purpose,…
cloudsurfin
  • 2,467
  • 2
  • 25
  • 29
67
votes
3 answers

How do I set up CLion to compile and run?

I just downloaded CLion from https://www.jetbrains.com/ because I just love the rest of their products. However, I'm having problems configuring it. I'm not able to compile and run my application (a simple "hello world"). When I try to run the…
Andurit
  • 5,612
  • 14
  • 69
  • 121
66
votes
3 answers

"Use of a signed integer operand with a binary bitwise operator" - when using unsigned short

In the following C snippet that checks if the first two bits of a 16-bit sequence are set: bool is_pointer(unsigned short int sequence) { return (sequence >> 14) == 3; } CLion's Clang-Tidy is giving me a "Use of a signed integer operand with a…
SakoDaemon
  • 973
  • 1
  • 6
  • 21
60
votes
2 answers

How to create a C project with CLion

since CLion has released a month ago there aren't many documents about it. So I'm confused about how to create a c project with CLion, when I want to create a new project I just asks the name of the project and creates a default main.cpp and…
fx773d
  • 601
  • 1
  • 5
  • 3
56
votes
2 answers

Where does CLion store executable files?

I install the CLion on a Ubuntu 14.04. I build my first project with help CMakeLists.txt: Source file: #include using namespace std; int main() { cout << "Hello, World!" << endl; return…
Denis
  • 3,595
  • 12
  • 52
  • 86
53
votes
3 answers

How to include external library (boost) into CLion C++ project with CMake?

I have the following setup for C++ development: OS X Yosemite CLion 140.2310.6 (a cross-plattform C/C++-IDE by JetBrains using CMake as build system) installed boost via brew install boost into /usr/local/Cellar/boost/ Now, my goal is to setup a…
nburk
  • 22,409
  • 18
  • 87
  • 132
51
votes
6 answers

In Clion's debugger, how do I show the entire contents of an int array

Right now it is only showing the first element of the array but I want a visual of all the elements in the array. I think Clion is using GDB. EDIT: I am referring specifically to arrays on the heap. Arrays on the stack can be visualised.
Embedded_Mugs
  • 2,132
  • 3
  • 21
  • 33
49
votes
4 answers

Using clang-format in CLion

I'd like to format my code using clang-format in CLion. I've gone through the settings and haven't found any setting that would allow me to run an external command to transform code. How are such things normally done in CLion?
Klemen Forstnerič
  • 914
  • 1
  • 10
  • 11
46
votes
3 answers

Setup Google test in CLion

I have been sitting online for hours already trying to setup Google test on Clion in Linux but have not been able to find anything. Can someone guide me with setting this up please?
user2955610
  • 815
  • 2
  • 9
  • 15
45
votes
2 answers

How to clear CMake cache in Clion?

I am currently trying to swap static libraries in one of my projects which requires swapping find_package() commands for explicit links to static libraries. One of the problems I encountered is that even after deleting find_package() commands…
Arkadi Sim
  • 553
  • 1
  • 4
  • 7
44
votes
6 answers

MinGW sh.exe must NOT be in your path

Currently trying to setup my C development environment on windows with MinGW and it looks like CMAKE is giving me the following error: sh.exe was found in your PATH, here: C:/Program Files/Git/user/bin/sh.exe For MinGW make to work correctly sh.exe…
user7322714
44
votes
6 answers

How to Create, Compile, And Run a single file in CLion

I am working on some c++ stuff and I hate having to create a whole new project just to run a few things on a file. I also don't like how when you create a project a file is already called main.cpp. I just want to make a single file with a few…
Rishi Desai
  • 441
  • 1
  • 4
  • 5
1
2 3
99 100