cmake

CMake - Undefined Reference

不问归期 提交于 2021-02-10 06:42:46
问题 I am trying to include gtest to my project. The problem is that I get a undefined reference error in the GTest. I am trying to test the Node class in Gtest. Inside the constructor of the Node I am using the Class Logger. Although I have added the library logger to the gtest-target I still the undefined reference error regarding to the Logger.... My guess CMake does no look for nested classes that are used inside Node. only Node itself. Temperoy fix If I use the Logger in the gtest-node.cpp it

Undefined reference after using CMAKE to generate a makefile

北慕城南 提交于 2021-02-10 06:11:07
问题 I can generate my CMake project, but I can't build it. I have a fairly straightforward project structure: ├── bin ├── build ├── CMakeLists.txt ├── include │ └── project │ ├── base_socket.h │ ├── tcp_client.h │ ├── tcp_server.h │ ├── udp_client.h │ └── udp_server.h ├── LICENSE.txt ├── README.md └── src └── project ├── base_socket.cpp ├── CMakeLists.txt ├── main.cpp ├── tcp_client.cpp ├── tcp_server.cpp ├── udp_client.cpp └── udp_server.cpp And a fairly straight forward CMakeLists.txt file in

Undefined reference after using CMAKE to generate a makefile

此生再无相见时 提交于 2021-02-10 06:08:57
问题 I can generate my CMake project, but I can't build it. I have a fairly straightforward project structure: ├── bin ├── build ├── CMakeLists.txt ├── include │ └── project │ ├── base_socket.h │ ├── tcp_client.h │ ├── tcp_server.h │ ├── udp_client.h │ └── udp_server.h ├── LICENSE.txt ├── README.md └── src └── project ├── base_socket.cpp ├── CMakeLists.txt ├── main.cpp ├── tcp_client.cpp ├── tcp_server.cpp ├── udp_client.cpp └── udp_server.cpp And a fairly straight forward CMakeLists.txt file in

How do you handle recursive dependencies in CMake

不打扰是莪最后的温柔 提交于 2021-02-09 20:30:36
问题 Say I have packages A, B, and C. Package B uses package A and package C uses package B. I create shared libraries. So in package B I do something like find_package(A) ... if(${A_FOUND}) target_link_libraries(B ${A_LIBRARIES}) endif() and in package C I do find_package(B) ... if(${B_FOUND}) target_link_libraries(C ${B_LIBRARIES}) endif() add_executable(main main.cpp) target_link_libraries(main C) where ${B_LIBRARIES} contains only B. The compiler will now complain /usr/bin/ld: cannot find -lA

How do you handle recursive dependencies in CMake

时间秒杀一切 提交于 2021-02-09 20:28:56
问题 Say I have packages A, B, and C. Package B uses package A and package C uses package B. I create shared libraries. So in package B I do something like find_package(A) ... if(${A_FOUND}) target_link_libraries(B ${A_LIBRARIES}) endif() and in package C I do find_package(B) ... if(${B_FOUND}) target_link_libraries(C ${B_LIBRARIES}) endif() add_executable(main main.cpp) target_link_libraries(main C) where ${B_LIBRARIES} contains only B. The compiler will now complain /usr/bin/ld: cannot find -lA

No rule to make target 'C:/opencv/build/lib/libopencv_world300d.dll.a', needed by 'opencv.exe'. Stop

南楼画角 提交于 2021-02-09 11:00:15
问题 So I'm trying to build a simple opencv code but I keep getting this error and I don't seem to find any solution in the internet: os: Windows 8.1 compiler GNU GCC 601 IDE: CLion CMake 3.0 and mingw64 This is the code which I got from the opencv tutorial page #include <stdio.h> #include <opencv2/opencv.hpp> using namespace cv; int main(int argc, char** argv ) { if ( argc != 2 ) { printf("usage: DisplayImage.out <Image_Path>\n"); return -1; } Mat image; image = imread( argv[1], 1 ); if ( !image

No rule to make target 'C:/opencv/build/lib/libopencv_world300d.dll.a', needed by 'opencv.exe'. Stop

帅比萌擦擦* 提交于 2021-02-09 10:58:28
问题 So I'm trying to build a simple opencv code but I keep getting this error and I don't seem to find any solution in the internet: os: Windows 8.1 compiler GNU GCC 601 IDE: CLion CMake 3.0 and mingw64 This is the code which I got from the opencv tutorial page #include <stdio.h> #include <opencv2/opencv.hpp> using namespace cv; int main(int argc, char** argv ) { if ( argc != 2 ) { printf("usage: DisplayImage.out <Image_Path>\n"); return -1; } Mat image; image = imread( argv[1], 1 ); if ( !image

No rule to make target 'C:/opencv/build/lib/libopencv_world300d.dll.a', needed by 'opencv.exe'. Stop

纵饮孤独 提交于 2021-02-09 10:57:29
问题 So I'm trying to build a simple opencv code but I keep getting this error and I don't seem to find any solution in the internet: os: Windows 8.1 compiler GNU GCC 601 IDE: CLion CMake 3.0 and mingw64 This is the code which I got from the opencv tutorial page #include <stdio.h> #include <opencv2/opencv.hpp> using namespace cv; int main(int argc, char** argv ) { if ( argc != 2 ) { printf("usage: DisplayImage.out <Image_Path>\n"); return -1; } Mat image; image = imread( argv[1], 1 ); if ( !image

基于OpenVINO的端到端DL网络-Tesseract5+VS2017+win10源码编译攻略

[亡魂溺海] 提交于 2021-02-09 09:04:36
一,记录我目前在win10 X64和VS2017的环境下成功编译Tesseract5.0的方式; 二,记录在VS2017 C++工程中调用 Tesseract4.0 的方法; 三,记录编译和调用 Tesseract4.0过程 中踩到的坑和相应的解决方案或看法。 最终结果: 识别为: ======================================================================================================================= 一、资料准备 1 下载 最新的CPPAN版本。解压缩后,将cppan.exe所在的路径添加到系统变量中; CPPAN是跨平台的C / C++ 依赖管理器。它建立在 CMake 的基础之上,并具有构建系统的能力。CPPAN 支持快速的脚本式编码和原型制作,以及处理大型项目。查找,共享和重用库,发布您的项目。把时间花在你的代码上,而不是管理依赖关系。CPPAN为您降低包时间到几秒钟!它支持简单的交叉编译,继承和推送你自己的设置,标志到每个依赖。 链接为 https://cppan.org/client/ 编译过程中相应的支持库是由cppan下载的,我们需要下载cppan并设置其环境变量 解压后 在系统变量里面选择PATH变量,将cppan

Building 64bit application with makefiles using cmake-gui

落花浮王杯 提交于 2021-02-09 02:50:11
问题 When I run cmake-gui and hit configure, I can specify the generator for my project. I can choose Visual Studio solution, Eclipse, makefiles etc... I am on 64bit system and want to build 64bit application. Till now, I used Visual Studio 10 Win64 generator to generate my solutions. No I want to (have to) build it with makefiles. But there is no options 32b/64b. Are makefiles for 64bit build used by default (on 64b system) and for 32b only after using something like export CFLAGS=-m32 inside my