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
16
votes
5 answers

Clion or cmake does not see environment variable

I'm using CLion IDE, Cmake and trying to write Hello world using CERN ROOT library. CMakeLists.txt: message(STATUS $ENV{ROOTSYS}) ~/.bashrc: export ROOTSYS="$HOME/tools/root-build/" During build in CLion $ENV{ROOTSYS} is empty by some reason. But…
A.Sizov
  • 171
  • 1
  • 1
  • 7
16
votes
4 answers

Clion how to add files to a project

This seems really basic. How can i add files to a project without having to manually edit the CMakeLists.txt. For example source files in another directory
jkj yuio
  • 2,543
  • 5
  • 32
  • 49
16
votes
2 answers

CLion and CMake: only building a library without an executable?

How to only build a static library with clion without having an executable? How does the CMakeLists.txt look like? (without add_executable) Update: If I don't add executable to Clion, I have an error, that an executable is required. Here my…
ilw
  • 2,499
  • 5
  • 30
  • 54
15
votes
1 answer

CLion recommends to use 'strtol' instead of 'scanf'

#include int main(int argc, char** argv) { int num = 0; printf("Input: "); scanf("%d", &num); <<< printf("%d\n", num); return 0; } scanf("%d", &num); Clang-Tidy: 'scanf' used to convert a string to an integer…
EnDelt64
  • 1,270
  • 3
  • 24
  • 31
15
votes
1 answer

Clion Unintialized record type: player

I have started learning C++ a few weeks ago. I am seeing now classes and all the stuff, and I was wondering about object instantiation. In this code: class Player { public: int x, y; int speed; }; int main () { Player player…
vrodriguez
  • 335
  • 3
  • 11
15
votes
6 answers

How do I remove CLion-2016.2.3 completely from Ubuntu 16.04 LTS?

I had installed CLion(2016.2.3) IDE from CLion-2016.2.3.tar.gz file. I accidentally deleted the CLion-2016.2.3.tar.gz file and CLion-2016.2.3 folder(which I got after extracting CLion-2016.2.3.tar.gz). Now CLion isn't working. When I ran dpkg --list…
Gautam Vashisht
  • 337
  • 2
  • 3
  • 17
15
votes
1 answer

How to set up basic openMP project in CLion

I am trying to run simple OpenMP program in CLion IDE. When I run it I get an ERROR: CMakeFiles\openmp_test_clion.dir/objects.a(main.cpp.obj): In function `main': D:/.../openmp_test_clion/main.cpp:9: undefined reference to…
PeterB
  • 2,234
  • 6
  • 24
  • 43
15
votes
2 answers

How to install CMake on Cygwin?

I have some difficulties to use Cygwin. I need that compiler to use CLion IDE by Netbrains. Can you explain me how to install CMake by the cygwin-terminal ? Thank you.
Romain-p
  • 518
  • 2
  • 9
  • 26
14
votes
4 answers

CLion code navigation with C++ doesn't work

I've used AppCode (Intellij C++/ObjC IDE that replaces Xcode) for a while and really gotten used to being able to Ctrl+Click on any identifier to get to its definition/decleration. Now on a new work place, I'm using CLion for a somewhat larger…
shoosh
  • 76,898
  • 55
  • 205
  • 325
14
votes
1 answer

How to link shared library *dll with CMake in Windows

I have 2 files: library.dll and library.h with some code that I need in my own project. I'm working on Windows with Clion where I should config this with CMake. I tried this way: cmake_minimum_required(VERSION…
JohnyBe
  • 313
  • 1
  • 2
  • 10
14
votes
4 answers

How to change C++ include guards in CLion?

When CLion creates a header file it adds include guard strings like this: #ifndef PROJECTNAME_FILENAME_H #define PROJECTNAME_FILENAME_H /* ... code ... */ #endif //PROJECTNAME_FILENAME_H But I want just FILENAME_H without the PROJECTNAME_ prefix.…
Kroll
  • 649
  • 2
  • 6
  • 17
14
votes
2 answers

CLion run program in separate system terminal

I have an ncurses program that I'd like to interactively debug using CLion. The problem is that when I run the program in CLion to debug it, the inbuilt console where the program is run doesn't display the output of the ncurses program properly. I'd…
CS Student
  • 1,613
  • 6
  • 24
  • 40
14
votes
3 answers

CLion indexer does not resolve some includes in the project directory

I have a CLion C++ project that has the following structure: project ---->my_includes | ----> my_own.hpp ---->source ----> my_app ----> my_src.cpp The first line of my_src.cpp is #include…
CPayne
  • 516
  • 2
  • 5
  • 20
14
votes
2 answers

CLion - GDB: current version is GNU gdb (GDB) (Cygwin 7.10.1-1) 7.10.1; supported version is 7.8.x

I am trying to use CLion on Windows and I installed my environment using cygwin but I'm getting this warning in the settings. Moreover, it's almost impossible to debug because the debugger just stops showing debugger info in the middle.
Raghav Mehta
  • 203
  • 2
  • 14
14
votes
4 answers

Running CLion on the System console (like Visual Studio)

I am trying to run a simple C++ program on CLion. The problem is that when I try to compile and run it, it shows the result in the application console. I want to run on the System console like the Visual Studio runs the output of the console apps.…
StefanL19
  • 1,476
  • 2
  • 14
  • 29