clion

How to configure CLion IDE for Qt Framework?

人走茶凉 提交于 2019-11-27 09:20:53
问题 How to configure CLion IDE for Qt Framework? Is this IDE compatible with Qt, or are there other IDEs compatible with Qt? I just want to try to use something else than Qt Creator. 回答1: I was as desperate as you, until I read this Quora discussion. It worked perfectly for me! To summarize, there are 2 main steps: Firstly, CLion uses CMake to compile your code. It is based on CMake configuration files (e.g "CMakeLists.txt"). You have to add Qt based CMake commands (the lines with 'find_package'

How to include external library (boost) into CLion C++ project with CMake?

≡放荡痞女 提交于 2019-11-27 09:15:42
问题 I have the following setup for C++ development: OS X Yosemite CLion 140.2310.6 (a cross-plattform C/C++-IDE by JetBrains using CMake as build system) installed boost via brew install boost into /usr/local/Cellar/boost/ Now, my goal is to setup a simple project and include the boost library. I defined just one test.cpp file that looks like this: #include <iostream> #include <boost> using namespace std; int test() { cout << "Hello, World!" << endl; return 0; } My CMakeLists.txt file looks like

How do I set up CLion to compile and run?

江枫思渺然 提交于 2019-11-27 06:07:34
I just downloaded CLion from https://www.jetbrains.com/ because I just love the rest of their products. However I'm having problems configuring it. I'm not able to compile and run my application (a simple "hello world"). When I try to run the application it refers me to "Edit configuration", so I added a new application and now I have this problem: I cannot specify the "target"; the only thing I can do is set "All targets". I cannot specify the "configuration" (all tutorials I found have Debug or Run here). Executable? Hmm. Should the path to GCC be here? (C:\MinGW\bin\gcc.exe) The rest of the

Where does CLion store executable files?

让人想犯罪 __ 提交于 2019-11-27 05:27:37
问题 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? 回答1: When you build under CLion,

How do I get CLion to run an install target

你离开我真会死。 提交于 2019-11-27 03:51:25
问题 I'm evaluating CLion 1.2.1 on an existing project which is already using CMake. The project is made up of a few library modules and a single executable. I have an install target which I use to collect the executable and a configuration file together in a bin folder for debugging: ... install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_BINARY_DIR}/bin/) install(FILES config.xml DESTINATION ${CMAKE_BINARY_DIR}/bin/) When building on the command line I'd just run: make install which as expected

How to enable C++11 in CLion?

旧时模样 提交于 2019-11-27 01:59:00
I'm trying to run C++11 code in CLion but it doesn't work. It says: ... /projects/CLion/untitled/main.cpp:7:1: note: C++11 ‘constexpr’ only available with -std=c++11 or -std=gnu++11 ... I tried to set CMAKE_C_FLAGS to -std=c++11 or -std=gnu++11 but I still have the same problem. Regular C++ code compiles fine. What flag do I have to set in CLion's CMake window to compile my C++11 code? I tried to set CMAKE_C_FLAGS According to the documentation the CMAKE_C_FLAGS set C language flags for all build types . For C++ you need use CMAKE_CXX_FLAGS instead: set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}

Output for CLion IDE sometimes cuts off when executing a program

只谈情不闲聊 提交于 2019-11-26 23:35:43
问题 When using CLion I have found the output sometimes cuts off. For example when running the code: main.cpp #include <stdio.h> int main() { int i; for (i = 0; i < 1000; i++) { printf("%d\n", i); } fflush(stdout); // Shouldn't be needed as each line ends with "\n" return 0; } Expected Output The expected output is obviously the numbers 0-999 on each on a new line Actual Output After executing the code multiple times within CLion, the output often changes: Sometimes it executes perfectly and shows

Using local makefile for CLion instead of CMake

吃可爱长大的小学妹 提交于 2019-11-26 18:42:46
问题 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. 回答1: 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

How do I change the working directory for my program

别说谁变了你拦得住时间么 提交于 2019-11-26 17:49:59
问题 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. 回答1: 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

How to execute a CLion program in gnome terminal?

社会主义新天地 提交于 2019-11-26 17:07:34
问题 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. 回答1: Yes, you can execute a Clion c/c++ program in a gnome terminal from the IDE. Here is how: