clion

sending EOF to stdin in Clion IDE

天涯浪子 提交于 2019-11-28 09:05:40
Is there a way to send EOF to stdin when running a c program in Clion IDE? I tried ctrl+D - it simply shuts the program down. Ctrl+Z doesn't work either. Any ideas? BTW - I'm using it on a Windows 10 OS. ctrl+D does the job, however there is a known problem , to avoid it disable option run.processes.with.pty in Registry (Find Action > Registry). Another option is to run the program from command line, and attach to it from CLion. In that case, you'll have your native shell. It's detailed at https://blog.jetbrains.com/clion/2016/01/attach-to-local-process/ The process is very simple - after

How can I expand the max width of the Run Tool Window in Clion/Intellij?

拥有回忆 提交于 2019-11-28 06:26:46
问题 As you can see, there's plenty of space for the text to expand to the right, but it gets wrapped at 120 characters. I have tried turning off soft wrapping (the little button on the right side), I tried going into the settings, under editor -> general -> console, unchecking "use soft wraps in console", and increasing the "console commands history size", but none of these have worked. I'd like for the cout of my program to continue to the right, and ideally just make a horizontal scroll bar

Where does CLion store executable files?

一个人想着一个人 提交于 2019-11-28 04:49:54
I install the CLion on a Ubuntu 14.04. I build my first project with help CMakeLists.txt: Source file: #include <iostream> using namespace std; int main() { cout << "Hello, World!" << endl; return 0; } CMakeLists.txt: cmake_minimum_required(VERSION 2.8.4) project(sh) set(SOURCE_FILES main.cpp) add_executable(sh ${SOURCE_FILES}) My source file is located in a /home/user/Desktop/sh . But after build, I don't see any executable file in this folder. Where is it? When you build under CLion, It prints the path it sends the executable to the Console: -- Build files have been written to: /home/<user>/

Including directories in Clion

六月ゝ 毕业季﹏ 提交于 2019-11-28 01:10:23
问题 Whenever I wanted to include a directory that was located outside of my project with Clion I would use the -I somedir flag. This time however, what I want to do is to have a hierarchy like this: /project CMakeLists.txt /src /Graph Graph.h Graph.cpp /Dijkstra Dijkstra.h Dijstra.cpp I want my code in a /src directory. And not only that, but also, for example, inside the file Dijkstra.h I want to include the Graph.h like this: #include "Graph/Graph.h and not like this: #include "../Graph/Graph.h

Change default CMakeLists.txt in CLion to include warnings

…衆ロ難τιáo~ 提交于 2019-11-28 00:49:30
问题 In CLion the default CMakeLists.txt sets the C++11 compiler flag only. I'd like to have warnings and the pedantic flag by default in all my projects. This is by default set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") and I'd like to have this by default so I don't have to change it every time I create a new project set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -W -Wall -Wextra -pedantic") In the "Settings" - "File and Code Templates" I can change the C++ header/source template but

How to clear CMake cache in Clion?

坚强是说给别人听的谎言 提交于 2019-11-27 17:06:21
问题 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 reloading the CMake Project the old variables are still present. Is there a way to explicitly flush the CMake cache other than manually deleting all files from the temporary folder Clion creates for building the project? 回答1: Starting with CLion 1.5 144

Using local makefile for CLion instead of CMake

萝らか妹 提交于 2019-11-27 16:35:25
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. Even though currently only CMake is supported, you can instruct CMake to call make with your custom Makefile . Edit your CMakeLists.txt adding one of these two commands: add_custom_target add_custom_command When you tell CLion to run your program, it will try to find an executable with the same name of the target in the directory pointed by PROJECT_BINARY_DIR . So as long as your make generates the file where CLion expects, there will be no

How to execute a CLion program in gnome terminal?

爷,独闯天下 提交于 2019-11-27 15:36:29
This question already has an answer here but I am using CLion version 1.2.1 and the answer in that post doesn't help. It is possible to run a CLion program in gnome terminal instead of its own console ? If yes, how ? Thanks. EDIT : I know where the executable file are stored but want to know if it is possible to run the file in terminal directly from the ide i.e. by selecting the run option in ide. Glacier11 Yes, you can execute a Clion c/c++ program in a gnome terminal from the IDE. Here is how: In the top right of your clion application you should see your project name or "Build All". Click

Setup Boost in Clion

↘锁芯ラ 提交于 2019-11-27 15:13:15
问题 How to use Boost library in Clion with MinGW ? I have downloaded and unzipped boost_1_60_0.zip to C:\boost_1_60_0 . What am I supposed to do now ? Do I have to install something ? Here is my CMakeLists.txt : cmake_minimum_required(VERSION 3.3) project(server_client) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -s -O3") set(CMAKE_EXE_LINKER_FLAGS -static) set(BOOST_ROOT "C:/boost_1_60_0") set(BOOSTROOT "C:/boost_1_60_0") find_package(Boost 1.60.0) if(NOT Boost_FOUND) message(FATAL_ERROR

How do I change the working directory for my program

坚强是说给别人听的谎言 提交于 2019-11-27 09:25:35
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 This can be changed via the Run -> Edit Configurations... dialog, just like Idea. The mix of needing to make changes to CMakeLists.txt for so much of the configuration just threw me, and I've been hunting for a way to change it there, but this bit at least is consistent with the other IDEs, which is good. Hopefully they'll improve the rest of the Project Settings in a similar fashion. The "Working Directory" is where