Category : clion

I am trying to build a c++ project with CLion IDE in windows. One of the cpp file includes mutex. but seems clion can’t find this. It says No member named ‘mutex’ in namespace ‘std’ Code snippet that showing this error is typedef std::lock_guard<std::mutex> my_lock; static std::mutex my_mutex_; And my CMakeLists.txt file contains cmake_minimum_required(VERSION 3.20) ..

Read more

I want to study an open source medical image annotation software ASAP, https://github.com/computationalpathologygroup/ASAP. Boost is needed. Boost has been introduced successfully, as shown in Figure 1. But it will report an error when it runs, just say it. , I haven’t used cmake much, this is really a blind spot. CMakeFilescore.dir/objects.a(filetools.cpp.obj): In function `core::extractFilePath(std::__cxx11::basic_string<char, std::char_traits<char>, ..

Read more

When i’m trying to use emplace method of unordered_map my IDE (CLion 2021.1.2 Build #CL-211.7442.42) inserts a template keyword before emplace method. I don’t get it why it is used in my case? Example: template<typename T> class Store { public: void Set(std::string const& key, T value) { storage_.template emplace(key, std::move(value)); } private: std::unordered_map<std::string, T> storage_; ..

Read more

I want to have my exe and dll files all be generated in the same folder, currently they are generated into a main cmake-build-* folder and then sub folder. cmake-build-debug ├──program.exe └───library_subfolder └library.dll Whereas my desired output would be all compiled files to be together like such cmake-build-debug ├──program.exe └──library.lib cmake_minimum_required(VERSION 3.15) project(Brigitte) set(SOURCE main.cpp ..

Read more

I’m using CMake for my big project and target_precompile_headers for generating .pch file. Problem: each time then I add or delete .cpp file in target source list, every translation unit gets recompiled To demonstrate issue I created very basic project with this structure: CMakeLists.txt is very simple: cmake_minimum_required(VERSION 3.16) set(CMAKE_CXX_STANDARD 17) project(SuperBasicProject) set(TARGET_NAME ${PROJECT_NAME}) add_executable(${TARGET_NAME} ..

Read more

Currently when I try to run a binary as debug this happens: ‘/Users/user/Documents/project/cmake-build-debug/project’ doesn’t contain any ‘host’ platform architectures: arm64e, arm64, x86_64, x86_64, arm64, arm64e In release mode everything works just fine. The object file that I am using is the source of problems since without it and dependencies everything works just fine. I cannot ..

Read more

I am new to the Clion tools. I have a docker container run in my remote machine. What is the best practice to connect to the docker container? Note: The docker is running on the remote machine instead of the local host. There are plenty of docs for using docker in local host. Source: Windows ..

Read more