cmake

how to link .so files with CMake [duplicate]

荒凉一梦 提交于 2021-01-28 05:57:31
问题 This question already has answers here : cmake and libpthread (4 answers) Undefined reference to pthread_create in Linux (14 answers) Closed yesterday . I want to rebuild a simple application based on a .cpp, a .h and multiple .so files. From what i've seen, my CMakeLists.txt should be like this : cmake_minimum_required(VERSION 3.5) set(CMAKE_CXX_STANDARD 11) project(test C CXX) add_executable(${PROJECT_NAME} main.cpp) target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_SOURCE_DIR}/lib)

Process exit code 0xC0000135 while running Qt hello world

亡梦爱人 提交于 2021-01-28 05:31:37
问题 Here is my main.cpp code: #include <iostream> #include <QtWidgets/QApplication> #include <QtWidgets/QPushButton> using namespace std; int main(int argc, char *argv[]) { QApplication application(argc, argv); QPushButton button("Hello, world!"); button.show(); return application.exec(); } Running it in CLion IDE (latest version) gives me the following error: Process finished with exit code -1073741515 (0xC0000135) Here is my CMakeLists.txt : cmake_minimum_required(VERSION 3.13) project(simple

Error while compiling Inkscape from source code

…衆ロ難τιáo~ 提交于 2021-01-28 05:22:13
问题 Not having well knowledge on dealing with C++ projects, I have downloaded the source code of Inkscape from its GitLab repository and made few changes (adding small feature) and tried to compile based on the instruction provided in INSTALL.md and other sources available on their website. While it seems I have all the dependencies installed on the system, I get this result after running cmake in build folder: ------------------------------ Building Makefile for Inkscape ------------------------

Specify targets in externalNativeBuild of the build.gradle file-> No signature of method

感情迁移 提交于 2021-01-28 05:13:31
问题 Start a new native c++ project in android studio 4.1.1. Go to build.gradle of the module Add a targets line: externalNativeBuild { cmake { path "src/main/cpp/CMakeLists.txt" version "3.10.2" targets "native-lib" // New line } } Somehow I get an error when I click the green play button (Run 'app'): Build file '<project folder>/app/build.gradle' line: 5 A problem occurred evaluating project ':app'. > No signature of method: build_bcdq4hni531na6stswx8a7txx.android() is applicable for argument

Building a simple C++ project on Windows, using CMake and clang

…衆ロ難τιáo~ 提交于 2021-01-28 04:51:19
问题 I'm trying to get a simple 'Hello World' program to build on Windows 10, preferably using CMake and clang. I can successfully compile, link and run the same project if I use the g++ compiler from MinGW, but have problems when I try using clang++. I have CMake, MinGW and LLVM already installed and accessible in my path: clang++ clang++: error: no input files cmake --version cmake version 3.16.0-rc1 I have set up environment variables for CMake to use clang: echo %CC% C:\Program Files\LLVM\bin

Add a static library (.a file) to an Android project with CMake, get “CMake Error: CMake can not determine linker language for target”

那年仲夏 提交于 2021-01-28 03:50:25
问题 I generate the static library from another Android project, so pretty sure they're useable. I got four .a files based on CPU architectures, one .h file which also has been tested. Now in new project, another .c file want to call the static library, i can't combine the two projects, the static libraries must be called in .a format. I got "CMake Error: CMake can not determine linker language for target", this is my CMakeLists.txt: add_library( mylib STATIC src/main/jniLibs/arm64-v8a/libmylib.a

How to remove a line of text in a string in CMake, working around CMake's lack of line-based regex matching?

爱⌒轻易说出口 提交于 2021-01-28 02:04:25
问题 I found out that CMake doesn't do RegEx the way I expected. Apparently, others have had this same problem as well. The issue is that CMake is not line-based. When you use the ^ or the $ operators, they work against the entire string, not the start and end of a line. I'm trying to remove all the lines in a file that say #include <blah.h> or #include "blah.h" . To do so, I whipped up a little function: function(deleteinplace IN_FILE pattern) file(READ ${IN_FILE} CONTENTS) string(REGEX REPLACE $

What is the correct way to link C++17 filesystem with CMake?

帅比萌擦擦* 提交于 2021-01-28 01:49:10
问题 I noticed that linking my CMake project with gcc 8.3 fails to link functions from std::filesystem. This is not the case with gcc 9, clang 7 or clang 8. I found solutions like this and this, but these hard-code the linking of stdc++fs , which is normally not what you want to do. So what is the correct way to link such libraries? Do I have to do a find_package ? What would be the package I am looking for? 回答1: It looks like there is no proper solution to this as of now. There still is an open

OpenVINO: How to build OpenCV with Inference Engine to enable loading models from Model Optimizer

爱⌒轻易说出口 提交于 2021-01-28 01:08:58
问题 I installed OpenVINO and want to run the following code on windows 10. import numpy as np import cv2 import sys from get_face_id import face_id_getter from check import check from win10toast import ToastNotifier FP = 32 targetId = 0 toaster = None if '-use_notifications' in sys.argv: toaster = ToastNotifier() if len(sys.argv) > 1 and '-m' in sys.argv: FP = 16 targetId = cv2.dnn.DNN_TARGET_MYRIAD cap = cv2.VideoCapture(0) getter = None if '-get_face_id' in sys.argv: getter = face_id_getter()

CMake: find wxWidgets built with MinGW/MSYS?

空扰寡人 提交于 2021-01-28 00:01:08
问题 I compiled wxWidgets 2.8.12 using MinGW. To actually do the build I invoked the autotools build files distributed with wxWidgets through the MSYS shell, using an install prefix of H:\MinGW-libs. The result of this is that I have a Unix style file tree containing my wxWidgets headers and libs (which are .a files, not .dll) with root directory H:\MinGW-libs. My problem is that I can't get CMake to find the files. When I try to use the "configure" button in the CMake gui it finds other