clion

How to properly set environment variable TERM in CLion

烂漫一生 提交于 2019-12-10 11:55:10
问题 Using CLion on OSX, I'm creating a simple console app in which I want to do a system("clear") . When I'm running the app in the OSX terminal, it works without issue. When I run it using the CLion terminal, the system("clear") fails with message : TERM environment variable not set. I first tried to manually set it in my cmakelists.txt file without success by doing set(ENV{TERM} "xterm-256color") I then tried to manually set it (followed by full restart) in CLion settings for both Console and

How to make Ctrl+V work in CLion

你离开我真会死。 提交于 2019-12-10 01:36:59
问题 I am having difficulty getting Ctrl + V to paste code in CLion (I am using version 1.1.1 for Windows). When I try to paste code copied using Ctrl + C from e.g. a website or another program, it only seems to work occasionally. Usually it pastes a piece of text that was not the most recently copied. I use other JetBrains IDEs (IntelliJ IDEA, PyCharm) and have never had any problems with something so basic. Has anybody else encountered this problem and found a solution to it? 回答1: I had the same

CLion run program in separate system terminal

匆匆过客 提交于 2019-12-10 01:36:39
问题 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 like to have the program run in my systems terminal so I can see the output properly whilst debugging the program with CLions debugger. Is there any way to do this? 回答1: The best way to accomplish this is to use GDB now it can be really

CLion inconsistent auto indentation for line comment

喜欢而已 提交于 2019-12-09 13:33:05
问题 There are some weird auto indentation going on in CLion that I don't understand why. Here is an example int i1(5); // some comments, then I hit Enter // auto indentation goes here. I hit Enter again // It goes here float f = 5; // some comments, then I hit Enter // then auto indentation goes here. I hit Enter again // It then goes here. float f2 = 6; // If I don't comment on the previous line, there is no weird indentation It seems like whenever I use = to initialize an variable, and then add

Setting CLion build and binary directory

牧云@^-^@ 提交于 2019-12-09 13:07:31
问题 I'm trying to build libwebsockets inside of my project in CLion. During build libwebsockets creates a header file that is required by other files and puts it in PROJECT_BINARY_DIR. CLion builds everything inside a random build directory it creates for the project and the header file ends up in that directory. I've tried: Setting the websockets_BINARY_DIR variable Setting the CMAKE_RUNTIME_OUTPUT_DIRECTORY variable Setting CMAKE_LIBRARY_OUTPUT_DIRECTORY variable Changing every variable in the

How set follow-fork-mode as child in debugger using CMake

二次信任 提交于 2019-12-09 11:20:55
问题 I have Linux system, and I writing program use Clion IDE which using CMake . I have a part my in program where I would like to debug child process I read a few topic from this forum, but I still doesn't know how or where just I can turn on this function: gdb debugging child process after fork (follow-fork-mode child configured) How do I debug the child process after fork() in gdb? I just have tryed to setup flag CMAKE_CXX_FLAGS_DEBUG as set follow-fork-mode child but CMake give me error.

C : Value escapes local scope?

假装没事ソ 提交于 2019-12-09 05:25:50
问题 So I have the following toString function: /* * Function: toString * Description: traduces transaction to a readable format * Returns: string representing transaction */ char* toString(Transaction* transaction){ char transactStr[70]; char id[10]; itoa(transaction -> idTransaction,id, 10); strcat(transactStr, id); strcat(transactStr, "\t"); char date[15]; strftime(date,14,"%d/%m/%Y %H:%M:%S",transaction -> date); strcat(transactStr, date); strcat(transactStr, "\t"); char amount[10]; sprintf

CLion indexer does not resolve some includes in the project directory

别说谁变了你拦得住时间么 提交于 2019-12-09 04:25:12
问题 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 "my_includes/my_own.hpp" I use an external build system that requires this inclusion format. The problem is if I use a function in my source file defined in the included header, CLion says "Cannot find my_own.hpp" if I try to hover over the inclusion. I tried marking the include directory as containing

How to install CMake on Cygwin?

浪尽此生 提交于 2019-12-09 02:36:53
问题 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. 回答1: Actually cmake is not a compiler. It is a wrapper to generate files for different make like programmes. The package is available in cygwin, You do not need to build from source. Before adding new package recommended to close all cygwin programmes. Then you should download the latest setup.exe programme (64 bit or or 32 bit

Prevent Auto Format from align Pointer to variable

若如初见. 提交于 2019-12-08 06:52:44
问题 When i click on Reformat Code Clion changes my pointers from: int* pointer; to: int *pointer; How can i prevent that from happening? I searched through the settings but couldn't find anything. 回答1: The alignment of pointers can be set in the code style settings. 来源: https://stackoverflow.com/questions/42697900/prevent-auto-format-from-align-pointer-to-variable