clion

CImg X11 Linking Error using CLion and CMake

試著忘記壹切 提交于 2019-12-07 19:34:49
问题 I have a C++ project in CLion (Ubuntu) that uses the CImg library. Currently, I cannot get the project to build properly. I have included the CImg.h file in my main.cpp file. I get an output like seen here. I made sure I had X11 tools installed by running the following command in the terminal: sudo apt-get install libx11-dev In the question linked to above, there is an answer that states to add the following compiler options: -L/usr/X11R6/lib -lm -lpthread -lX11 However, I run into 2 problems

Hide automatically generated CTest targets

隐身守侯 提交于 2019-12-07 14:16:20
问题 I'm using CMake and CTest in CLion. Annoyingly, CTest generates a load of targets that I don't care about: Continuous ContinuousBuild ContinuousConfigure ContinuousCoverage ContinuousMemCheck ContinuousStart ContinuousSubmit ContinuousTest ContinuousUpdate Experimental ExperimentalBuild ExperimentalConfigure ExperimentalCoverage ExperimentalMemCheck ExperimentalStart ExperimentalSubmit ExperimentalTest ExperimentalUpdate Nightly NightlyBuild NightlyConfigure NightlyCoverage NightlyMemCheck

Clion code formatting to align variables

被刻印的时光 ゝ 提交于 2019-12-07 12:53:30
问题 Is it possible to change the options in Clion so that the variables are aligned like so: This should be applied in structs and methods. 回答1: Yes. Settings -> Editor -> Code Style -> C/C++ -> Wrapping and Braces -> Variable groups -> Align in columns You can of course also use a custom formatting tool that does it as well. 来源: https://stackoverflow.com/questions/35550885/clion-code-formatting-to-align-variables

CLion build depend targets

泄露秘密 提交于 2019-12-07 06:12:20
问题 My CLions CMakeLists.txt contains more than 1 target (libraries and depends executables). How can I configure building all targets in one click, instead of choosing target one by one and building them? For example, in Visual Studio I can configure project dependencies and build all solution. CLions "Edit configurations..."->"Before launch:Build" won't work for me. 回答1: You can add the command add_dependencies to your CMakeLists.txt , it does what you want: Make a top-level target depend on

How to enable all compiler warnings in CLion?

时光毁灭记忆、已成空白 提交于 2019-12-07 01:00:49
问题 I want to see all compiler warnings in CLion. I don't want them treated as errors, but I want to inspect all of them. How can I do this? 回答1: Try to set compiler flag in CMakeLists.txt : set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra") Related question: How to enable C++11 in CLion? 回答2: For C: set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra") 回答3: Rebuild your entire project. Most compilers don't rebuild every file when you just press build, so you will only see warnings from

CLion doesn't resolve headers from external library

非 Y 不嫁゛ 提交于 2019-12-06 19:44:59
问题 Some time ago I started a big header library in C++1x using XCode. The current layout of the library is () something like (partial output from ls -R sponf ) sponf/sponf: ancestors sponf.h sponf_utilities.h categories sponf_children.h utilities children sponf_macros.h sponf/sponf/ancestors: function.h meter.h set.h simulation.h sponf/sponf/categories: free_space.h prng.h random_distribution.h series.h sponf/sponf/children: distributions histogram.h random simulations meters numeric series

Prevent Auto Format from align Pointer to variable

走远了吗. 提交于 2019-12-06 19:10:28
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. 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

CLion contexts and CMakeCache

荒凉一梦 提交于 2019-12-06 08:40:02
I am running into the problem of easily switching between Debug and Release builds of my projects in CLion. After looking around, I found that in 2016, the system was changed and many users ran into trouble. However, none of the fixes that were suggested helped me. Under Settings / Cmake, I entered two profiles, Release and Debug. However, in both the configuration selection at the top right of the editor and the context selection at the bottom right of the editor, only the first of the two profiles is available. Also, the first profile seems to work fine with CMake, whereas for the second one

CLion can't find shared library when running an executable

a 夏天 提交于 2019-12-06 07:52:25
问题 I am working on a project. I've been using a simple editor so far and my own Makefile to build it. I would like to switch to CLion, though. According to this question you can tell CMake to run your Makefile. So my CMake.txt looks like this: cmake_minimum_required(VERSION 3.6) project(rekotrans_testbed_simulator) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") add_custom_target(rekotrans_testbed_simulator COMMAND make -C ${rekotrans_testbed_simulator_SOURCE_DIR} CLION_EXE_DIR=${PROJECT

Importing Bazel Project fails in CLion on macOS

时光总嘲笑我的痴心妄想 提交于 2019-12-06 04:03:28
问题 I installed Bazel plugin on my CLion and am trying to import a new Bazel C++ project and I keep hitting into these errors- tensorflow_gpu-1.8.0lft1-cp27-cp27mu-linux_x86_64.whl is not a supported wheel on this platform. ERROR: error loading package '': Encountered error while reading extension file 'requirements.bzl': no such package '@my_deps//': Traceback (most recent call last): File "/private/var/tmp/_bazel_pmanjunath/0f9184e7a61c3740275307da0cc42014/external/io_bazel_rules_python/python