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
41
votes
3 answers

CMake - Creating a static library

I have two files in my project called Test4: Structure.h Structure.c I want to create a static library that can be loaded by other projects who want to use those files. Here is my CMake file currently: cmake_minimum_required(VERSION…
Hatefiend
  • 3,416
  • 6
  • 33
  • 74
41
votes
4 answers

Clion 2016.3: switch to "Release" configuration

I updated to clion 2016.3 recently and noticed that I cannot choose between different configuration types anymore. With 2016.2 I had the choice between "Debug", "Release", "MinSizeRel" and "RelWithDebInfo", but now the only available option is…
Felix
  • 6,131
  • 4
  • 24
  • 44
38
votes
5 answers

Is it possible to configure CLion to compile source files in a project independently?

I am currently doing some Project Euler challenges in C using the JetBrains CLion IDE. When I completed these in Python and Java (in PyCharm and IntelliJ, respectively), I was always able to create a single project named "ProjectEuler" and add any…
nidorion
  • 383
  • 1
  • 4
  • 5
37
votes
5 answers

How to add CLion icon to desktop in Ubuntu

I am using Ubuntu and CLion 2016.1. I installed it by downloading tar.gz archive. Now I have such CLion-2016.1/bin folder. For launching Clion I run ./clion.sh. How can I add CLion icon to desctop?
Kenenbek Arzymatov
  • 8,439
  • 19
  • 58
  • 109
34
votes
4 answers

How to debug a forked child process using CLion

I was debugging a Linux C program with CLion's internal debugger (which is gdb on Linux). The program forked a child process that was supposed to get suspended at the break point I set. But the debugger didn't stop there even if I had entered set…
DYS
  • 2,826
  • 2
  • 23
  • 34
34
votes
3 answers

Does CLion IDE include all features which ReSharper C++ provides under Visual Studio?

Since I've been using for some while ReSharper for C# (and other JetBrains tools) and have been very pleased with the experience, I'm oscillating regarding which would be the better option, between the 2 JetBrains products (from the title) for C++…
Teodor Tite
  • 1,855
  • 3
  • 24
  • 31
31
votes
3 answers

How to see actual value of a C++ string in CLion's debugger?

I'm using CLion on Linux and having difficulties with debugging. I evaluated an expression which ends up being a string, but the debugger is useless at showing me what the return value is, other than that it is a string. How do I see the actual…
Earlz
  • 62,085
  • 98
  • 303
  • 499
30
votes
2 answers

How to automatically generate function headers for .h file in Clion?

When writing a library in C, I usually end up implementing functions before defining them in the corresponding header file. As copying function header's in the header file is a repetitive task, I was wondering if I can automatically generate…
Ali Alavi
  • 2,367
  • 2
  • 18
  • 22
27
votes
1 answer

CMake was unable to find a build program corresponding to "Unix Makefiles"

I've installed CLion and I plan to start coding on C++. I've also installed Cygwin. I've researched for the last hour or so on how a compiler works and how to use it, but when I selected the compiler on Clion I get the errors CMake Error: CMake was…
AcousticScarf
  • 285
  • 1
  • 3
  • 5
27
votes
5 answers

CLion standard input while debugging

What I'm trying to do is basically: ./myProgram < myData.txt While I'm debugging with CLion IDE. I just can't find the option to do so. A similar question - but product-specific to MSVS
user5414301
  • 271
  • 1
  • 3
  • 3
27
votes
4 answers

CLion - Changing the default build directory

I've been having issues with changing the build directory via CLion. I've tried: set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "bin") but it does not seem to change and remains the same…
Adil
  • 572
  • 1
  • 6
  • 20
25
votes
3 answers

MSVC toolchain is not supported. Please use GNU toolchain

I was trying to debug Rust in CLion when I was greeted with the aforementioned I updated my toolchain setting to use the suggested default as such: How can I fix this issue and get CLion to be able to debug Rust code? I did some searching but…
Jonathan Woollett-light
  • 2,813
  • 5
  • 30
  • 58
25
votes
6 answers

CLion C++ can't read/open .txt file in project directory

I have a .txt file in my project directory that I made and populated with data. directory structure looks like: /Users/asd/ClionProjects/ProjectWithTemplates/ main.cpp cmake twoday.txt here is my code: #include #include #include…
Rekumaru
  • 421
  • 1
  • 4
  • 10
24
votes
2 answers

CLion/PyCharm/PHPStorm/IntelliJ won't start, says "IDE has not been initialized yet"

When I try to start my CLion IDE (or another JetBrains IDE, like PyCharm, IntelliJ IDEA, PHP Storm etc), it fails, and I get the following message on the console: IDE has not been initialized yet (after the usual JVM warning I always get before and…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
24
votes
3 answers

CLion: Enable debugging of external libraries by adding source files

I am using CLion 2016.2.2 and I want to debug a method in the libtins library. However, it looks like the sources are not available because when trying to jump into the methods from libtins, the debugger does not go into and just updates the current…
Patrick
  • 1,046
  • 2
  • 10
  • 31