OpenCV as a static library (cmake options)

I want to use OpenCV library in an embedded system and I need to compile my project using OpenCV as a static library. How can I create the library using cmake options ?

In CMake, how do I work around the Debug and Release directories Visual Studio 2010 tries to add?

I'm trying to build one of my CMake-based projects from a couple of years ago with Visual Studio 2010 and I'm running into problems to do with the output directory for a project. Visual Studio has...

How can I add a minimum compiler version requisite?

I want to create a project in C++11 and I use CMake as my build system. How can I add a minimum compiler version requisite in the CMake config files?

clang not detecting c++ headers on OS X

I'm trying to use clang to compile a simple hello world cpp file with our favorite #include 'iostream' But clang, for some reason shows fatal error: 'iostream' file not found This stumped me....

How can I build Rust code with a C++/Qt/CMake project?

I have an existing C++/Qt project built with CMake. I'd like to start adding Rust code which I can invoke from inside the main C++ codebase. What's the right way to structure the project? Current...

cmake: how to keep path to libraries during installation

I have some executable which depends on config files which relative path are setup in the source. The executable links against a library, which is created in the same project. What I am hoping to...

cmake error : opencv2/opencv.hpp:opencv2/opencv.hpp:No such file or directory

I am compiling opencv programs with cmake. The code is as follows: DisplayImage.cpp: #include <stdio.h> #include <opencv2/opencv.hpp> using namespace cv; int main(int argc, char** argv ) { ...

How do I tell CMake to use Clang on Windows?

I have a C++ project that builds using CMake. I usually build on OSX but now I am trying to get a Windows version working too. I would like to use Clang on Windows for compatibility reasons. I...

CMake Error at CMakeLists.txt:56 (include): include could not find load file: gmxVersionInfo

I was trying to install gromacs for which cmake is required. CMake installation have been done and no problem was shown in there. But when I tried to run this command cmake .....

cmake: why doesn't CMAKE_CXX_STANDARD seem to work with check_cxx_source_compiles

Here's an MCVE: cmake_minimum_required(VERSION 3.1) Project(Test) include(CheckCXXSourceCompiles) set (CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}") #set (CMAKE_CXX_STANDARD_REQUIRED...

How to get CMake to pass either std=c++14/c++1y or c++17/c++1z based on GCC version?

GCC 4.x doesn't accept the --std=c++14 switch for C++14 code - it takes --std=c++1y instead. Later versions take --std=c++1z but (probably) not --std=c++17 which has not been set yet (writing this...

c++ async sometimes resulting in std::system_error , and sometimes not

I am trying to get the code example from there to work: https://solarianprogrammer.com/2012/10/17/cpp-11-async-tutorial/ int twice(int m){ return 2*m; } int main(){ std::vector<...

How to debug a cmake/make project in VSCode?

I'm making a project and in order to assist in building, I'm using CMake. However, I notice that I can't debug. Here's my launch.json: { "version": "0.2.0", "configurations": [ { ...

cmake build .so library

My CMakeLists.txt is here. cmake_minimum_required(VERSION 3.9) project(iemoji-lab) set(CMAKE_CXX_STANDARD 14) SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY...

Beautify c++ files on VSCode

Context : VSCode 1.35.5 I have two projects in the workspace, one .js files and another with .cpp files. When i want to beautify a .cpp file, here is the following pop up : From File ->...

How to fix "Could not find toolchain file" "CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage" cmake libjpeg-turbo.so?

I am working on generating libjpeg-turbo.so files for different CPU architectures. If I execute the below cmake in my build folder I am getting this error even though the toolchain file is present...

ROS Kinetic 'catkin_make' Fails because PROJECT_NAME is set to Project

I have been using ROS Kinetic for a while, and today when I went to make a new catkin workspace following the ROS tutorials page (http://wiki.ros.org/catkin/Tutorials/create_a_workspace) I get a...

'Unable to open X display' error is produced by a CEF application running in windowless (off screen rendering) mode

[01] The application was built and executed in a docker. The Dockerfile is as follows: >>>> FROM ubuntu:xenial RUN apt-get update -y RUN apt-get install -y wget RUN...

rpmbuild check-rpath reports error that path is not absolute, incorrectly

I've been building RPMs using CMake & CPack 3.13.4 on OEL7 for several months without issue. My CMake configuration contained these lines: SET(CMAKE_SKIP_BUILD_RPATH ...

clang-tidy - ignore third party headers code

I'm using CMake for my project and I wanted to introduce clang-tidy checks to the project. I'm using for this purpose CMAKE_CXX_CLANG_TIDY and .clang-tidy file for checks setup. I wanted to use...

Pytorch says that CUDA is not available

I'm trying to run Pytorch on a laptop that I have. It's an older model but it does have an Nvidia graphics card. I realize it is probably not going to be sufficient for real machine learning but I...

Android SDK Tools: OpenCV requires Android SDK Tools revision 14 or newer

I'm trying to create a simple photo capture app using kivy, opencv. When I tried to create an .apk file using buildozer, and put opencv in requirements at .spec file then I faced this error --...

Getting error "CUDA backend requires cuDNN" when configuring OpenCV cmake build with cuda backend turned on

My goal: My goal is to configure a build of OpenCV 4.5.1-dev with support for cuda, tesseract and QT without any cmake error.. The problem I am having: I am getting the following error when I...

Qt. Copying file error while trying to run the project. How to fix a mistake and why is it happening?

I’m trying to install and create the first Qt project. I am using CLion with CMake and Qt 6. I set up CMake: cmake_minimum_required(VERSION 3.17) project(QSnake) set(CMAKE_CXX_STANDARD...

_ctypes.cpython-39-x86_64-linux-gnu.so: undefined symbol: PyFloat_Type in embedded Python loaded with dlopen

I am using embedded Python (3.9) in ubuntu 20.04 and trying to import ctypes which produces the error _ctypes.cpython-39-x86_64-linux-gnu.so: undefined symbol: PyFloat_Type. I am compiling a...

Android Gradle plugin 7.0.0 and NDK: UnsatisfiedLinkError

I recently updated Android Gradle Plugin to version 7.0.0 (Gradle version 7.0.2). Since I did this update, my native library continues to be compiled regularly, but no .so files are generated in...

How to install Boost.Python using homebrew (on OSX)?

I'm trying to install Robot Operating System (ROS) Melodic on my mac (macOS 11.5.1). While compiling cv_bridge package, the compiler spit out an error related to the Boost.Python: $...

CMake error while running flutter desktop application

When I am trying to launch flutter desktop application, this error occurred to me: "CMake Error at CMakeLists.txt:2 (project): Generator Visual Studio 16 2019 could not find any instance of...

Installing wxPython on Windows: DistutilsPlatformError: Microsoft Visual C++ 14.2 or greater is required

I have installed: Python 3.10.1 PyCharm Community 2021.3 Visual Studio Build Tools 2022, including: C++ Build Tools Core Features C++ 2022 Redistributable Update C++ core desktop features MSVC...

Using different struct definitions to simulate public and private fields in C

I have been writing C for a decent amount of time, and obviously am aware that C does not have any support for explicit private and public fields within structs. However, I (believe) I have found...