opencv in clion
嗨,我遇到了这个错误,我已经在cygwin
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: CMakeFiles/imageprocessing.dir/main.cpp.o: in function `cv::String::~String()':
/usr/include/opencv2/core/cvstd.hpp:648: undefined reference to `cv::String::deallocate()'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: CMakeFiles/imageprocessing.dir/main.cpp.o: in function `cv::String::operator=(cv::String const&)':
/usr/include/opencv2/core/cvstd.hpp:656: undefined reference to `cv::String::deallocate()'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: CMakeFiles/imageprocessing.dir/main.cpp.o: in function `cv::Mat::~Mat()':
/usr/include/opencv2/core/mat.inl.hpp:704: undefined reference to `cv::fastFree(void*)'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: CMakeFiles/imageprocessing.dir/main.cpp.o: in function `cv::Mat::release()':
/usr/include/opencv2/core/mat.inl.hpp:816: undefined reference to `cv::Mat::deallocate()'
collect2: error: ld returned 1 exit status
make[3]: *** [CMakeFiles/imageprocessing.dir/build.make:93: imageprocessing.exe] Error 1
make[2]: *** [CMakeFiles/Makefile2:83: CMakeFiles/imageprocessing.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:90: CMakeFiles/imageprocessing.dir/rule] Error 2
make: *** [Makefile:124: imageprocessing] Error 2**
库
cmake_minimum_required(VERSION 3.20)
project(imageprocessing)
set(CMAKE_CXX_STANDARD 23)
add_executable(imageprocessing main.cpp)
find_package( OpenCV REQUIRED )
。用户代码
#include <iostream>
#include <opencv2/opencv.hpp>
#include "opencv2/opencv.hpp"
using namespace cv;
using namespace std;
int main() {
Mat image;
cout << "Hello, World!" << std::endl;
return 0;
}
Hi I am getting this error I have installed OpenCV libraries in Cygwin Libraries
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: CMakeFiles/imageprocessing.dir/main.cpp.o: in function `cv::String::~String()':
/usr/include/opencv2/core/cvstd.hpp:648: undefined reference to `cv::String::deallocate()'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: CMakeFiles/imageprocessing.dir/main.cpp.o: in function `cv::String::operator=(cv::String const&)':
/usr/include/opencv2/core/cvstd.hpp:656: undefined reference to `cv::String::deallocate()'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: CMakeFiles/imageprocessing.dir/main.cpp.o: in function `cv::Mat::~Mat()':
/usr/include/opencv2/core/mat.inl.hpp:704: undefined reference to `cv::fastFree(void*)'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld: CMakeFiles/imageprocessing.dir/main.cpp.o: in function `cv::Mat::release()':
/usr/include/opencv2/core/mat.inl.hpp:816: undefined reference to `cv::Mat::deallocate()'
collect2: error: ld returned 1 exit status
make[3]: *** [CMakeFiles/imageprocessing.dir/build.make:93: imageprocessing.exe] Error 1
make[2]: *** [CMakeFiles/Makefile2:83: CMakeFiles/imageprocessing.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:90: CMakeFiles/imageprocessing.dir/rule] Error 2
make: *** [Makefile:124: imageprocessing] Error 2**
CMakeList.txt
cmake_minimum_required(VERSION 3.20)
project(imageprocessing)
set(CMAKE_CXX_STANDARD 23)
add_executable(imageprocessing main.cpp)
find_package( OpenCV REQUIRED )
User Code
#include <iostream>
#include <opencv2/opencv.hpp>
#include "opencv2/opencv.hpp"
using namespace cv;
using namespace std;
int main() {
Mat image;
cout << "Hello, World!" << std::endl;
return 0;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论