clion

Setting CLion build and binary directory

六眼飞鱼酱① 提交于 2019-12-03 16:52:38
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 CMake cache to point away from CLion's random directory Changing the build output path setting in CLion

CLion inconsistent auto indentation for line comment

若如初见. 提交于 2019-12-03 16:12:30
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 comment at the end of the line, it will give me extra indentation on the next line. But in all other

How to set up basic openMP project in CLion [duplicate]

女生的网名这么多〃 提交于 2019-12-03 13:27:46
问题 This question already has answers here : Undefined reference to `omp_get_max_threads_' (3 answers) Closed 3 years ago . I am trying to run simple OpenMP program in CLion IDE . When I run it I get an ERROR: CMakeFiles\openmp_test_clion.dir/objects.a(main.cpp.obj): In function `main': D:/.../openmp_test_clion/main.cpp:9: undefined reference to 'omp_get_thread_num' collect2.exe: error: ld returned 1 exit status Here is my code: #include <stdio.h> #include <omp.h> int main() { int id; #pragma omp

CLion doesn&#039;t resolve headers from external library

匿名 (未验证) 提交于 2019-12-03 08:36:05
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: 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 spaces sponf/sponf/children/distributions: arcsine_der

Using Qt inside Clion

妖精的绣舞 提交于 2019-12-03 07:30:32
问题 I'm trying to use Clion IDE to compile a simple program using Qt library, but I can't figure out how to configure CMakeLists.txt file. (I'm not familiar with cmake and toolchain) this is my current CMakeLists.txt file: cmake_minimum_required(VERSION 3.2) project(MyTest) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") set(SOURCE_FILES main.cpp) add_executable(MyTest ${SOURCE_FILES}) # Define sources and executable set(EXECUTABLE_NAME "MySFML") add_executable(${EXECUTABLE_NAME} main.cpp) #

Setting up ROS package in CLion

怎甘沉沦 提交于 2019-12-03 07:10:27
I am using CLion (C++ IDE) for editing a ROS package. I was able to open a package by opening the CMakeLists.txt file. But, I get an error, "FATAL_ERROR "find_package(catkin) failed. catkin was neither found in the workspace nor in the CMAKE_PREFIX_PATH. One reason may be that no ROS setup.sh was sourced before" How do I solve this problem? Will I be able to make the project in CLion (If so, how do I) after I make changes to the code or do I have to catkin_make in a separate terminal? Try this (for Linux): Open a command line Run catkin_make on your package. source your catkin_workspace/devel

C : Value escapes local scope?

久未见 提交于 2019-12-03 06:33:33
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(amount,"%g",transaction -> amount); strcat(transactStr,"$ "); strcat(transactStr, amount); return

How to Create, Compile, And Run a single file in CLion

无人久伴 提交于 2019-12-03 05:36:12
问题 I am working on some c++ stuff and I hate having to create a whole new project just to run a few things on a file. I also don't like how when you create a project a file is already called main.cpp . I just want to make a single file with a few functions or classes. It's not important enough to create a whole project. I want to create a file and call it what i want. Just create a file what I call, then compile and run. I don't want to deal with the whole CMake thing, just compile ONE file. No

CMake - Creating a static library

匆匆过客 提交于 2019-12-03 04:22:48
问题 I have two files in my project called Test4 : Structure.h Structure.c I want to create a static library that can be loaded by other projects who want to use those files. Here is my CMake file currently: cmake_minimum_required(VERSION 3.6) project(Test4) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") set(SOURCE_FILES Structure.c Structure.h) add_library(Test4 STATIC ${SOURCE_FILES}) When I build using that CMake file, no static library is generated. Nothing happens. Am I doing something

MinGW sh.exe must NOT be in your path

两盒软妹~` 提交于 2019-12-03 04:11:46
问题 Currently trying to setup my C development environment on windows with MinGW and it looks like CMAKE is giving me the following error: sh.exe was found in your PATH, here: C:/Program Files/Git/user/bin/sh.exe For MinGW make to work correctly sh.exe must NOT be in your path. Run cmake from a shill that does not have sh.exe in your PATH. If you want to use a UNIX shell, then use MSYS Makefiles That error is being thrown inside of CLion IDE. I am not sure if I need to change settings inside of