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
19
votes
2 answers

How to add existing source and headers file to the CLIon project

I am trying to add existing source files to my Clion project, but after adding (Copy and pasting) them to the project, these files were not added to the CMakeLists file. Also, the folder is semitransparent (gray colored). How can I automatically add…
fheoosghalzr
  • 243
  • 1
  • 3
  • 9
19
votes
3 answers

Defining preprocessor symbols for CLion analyzer

In my project there's a file enclosed in an ifdef preprocessor directive #ifdef SOME_SYMBOL ... entire file ... #endif SOME_SYMBOL is defined by another file that's compiled before this one, and the code works as expected, but the static analyzer…
Neowizard
  • 2,981
  • 1
  • 21
  • 39
19
votes
3 answers

How do I change the working directory for my program

Trying out the Clion EAP on the Mac. How does one change the current working directory for a launched program? It appears to be set to the output directory of the binaries.
sfjac
  • 7,119
  • 5
  • 45
  • 69
18
votes
2 answers

CLion won't show output in Debug

When I start up the program, this is the output: -------------------- HASHMAP MANAGEMENT BOOT MENU ------------------------- Would you like to: (a) create a new hashmap (b) load an existing one (q) exit > However, when debugging, none of this shows…
ENBYSS
  • 819
  • 1
  • 10
  • 22
18
votes
2 answers

How to add "-l" (ell) compiler flag in CMake

Work on Ubuntu 16 I used g++ main.cpp -lpq command for compiler my small project. Now I use Clion and wanna do same what I do with g++. But I can't add compiler flags in cmake file and get compile error. cmake_minimum_required(VERSION…
18
votes
3 answers

CLion Installation: Cmake compilers not found, GDB not found

I'm switching from VS to CLion and they said I needed to install Cygwin and CMake. I then installed both of them. I tried use bundled, but CLion still gives me these errors make: not found C Compiler: not found C++ Compiler: not found GDB: not…
Script Kitty
  • 1,737
  • 5
  • 27
  • 47
18
votes
4 answers

Clion and CMake messages

I just started using the Clion IDE. Maybe this is written somewhere but I haven't seen it in a Google search. If I put a message() call in my CMake script, where in Clion can I see the output? These message calls are the only way that I know how to…
krapht
  • 411
  • 5
  • 15
18
votes
4 answers

How can I add a prebuilt static library in a project using CMake?

CLion: How can I add (or use) a prebuilt static library in my project?
ilw
  • 2,499
  • 5
  • 30
  • 54
17
votes
2 answers

Turning off "created by" header when generating files in CLion

When you create file in CLion, the following header is placed in the top of file: // // Created by on 14.01.18. // Someone can remove this header by go to Settings → Editor → File and Code Templates → Includes → C File Header. There will…
diralik
  • 6,391
  • 3
  • 28
  • 52
17
votes
2 answers

Connecting to MySQL in C++

I am trying to learn C++ and I am having a bit of nightmare doing a test where I connect to a MySQL database. I've had issues with the MySQL connector not linking properly then was getting issues related to relocation truncated to fitr_x86_64_32…
Boardy
  • 35,417
  • 104
  • 256
  • 447
17
votes
4 answers

Clion memory view

I can't find a memory view in Jetbrain's clion IDE. Does anybody know to show it (has clion this feature)? Meant is this: memory view in eclipse
Martin Pfeffer
  • 12,471
  • 9
  • 59
  • 68
17
votes
3 answers

clion: exclude files from project view

My Project View in CLion lists not only C++ files and headers but also built libraries (.la) and object files (.o). I don't want to see them. What can I do to make them not appear in the list?
rwst
  • 2,515
  • 2
  • 30
  • 36
17
votes
2 answers

Clion: auto documenting functions, classes

Is there any shortcut or something like this to add, e.g. documentation of a function or class (similar to "///" in Visual Studio and C#)? Thanks!
leon22
  • 5,280
  • 19
  • 62
  • 100
17
votes
3 answers

Setting build target in CLion

I'm trying to set up CLion (windows 8.1, 64-bit, using cygwin and not mingw), and I'm trying to compile+run a project, but I don't know what to do here: It says I need a Target and a Configuration, but there're none in the dropdown. Is there a…
hintss
  • 398
  • 1
  • 3
  • 13
16
votes
1 answer

What is "Clang-Tidy: Function is within a recursive call chain" ? How to fix it?

I'm writing a function dealing with string in C, which is recursive. Basically what it does is to find a string between some characters and '\0'. If before it finds '\0', it hits on the particular characters, it will recursively call itself. When…
citrate
  • 189
  • 1
  • 1
  • 8