opencv / opencv

Open Source Computer Vision Library
https://opencv.org
Apache License 2.0
79.15k stars 55.83k forks source link

findopencv.cmake CMAKE_MODULE_PATH #8553

Closed dxqxiaoqiang closed 7 years ago

dxqxiaoqiang commented 7 years ago

find_package(OpenCV REQUIRED COMPONENTS core calib3d features2d imgproc highgui) find_package(Boost REQUIRED COMPONENTS system chrono filesystem unit_test_framework program_options) find_package(Ceres REQUIRED) find_package(OpenGL)

enable C++11 standard

set(CXX_STANDARD 11) set(CXX_STANDARD_REQUIRED ON)

include_directories(${Boost_INCLUDE_DIR}) link_directories (${Boost_LIBRARY_DIR}) include_directories(${BLAS_INCLUDE_DIRS}) link_directories (${BLAS_LIBRARY_DIRS}) include_directories(${LAPACK_INCLUDE_DIRS}) link_directories (${LAPACK_LIBRARY_DIRS})

find_package(Eigen3 REQUIRED) include_directories(${EIGEN3_INCLUDE_DIR}) message("Found Eigen3 in: ${EIGEN3_INCLUDE_DIR}") set(OpenCV_DIR /home/dxq/opencv-3.2.0/build) find_package( OpenCV REQUIRED ) add_executable( sfm main.cpp ) target_link_libraries( sfm ${OpenCV_LIBS} )


What's wrong with this  problem?@alalek
mshabunin commented 7 years ago

@dxqxiaoqiang , please, ask usage questions on forum: http://answers.opencv.org/

dxqxiaoqiang commented 7 years ago

i don't find uesfull information about this problem. @mshabunin

mshabunin commented 7 years ago

@dxqxiaoqiang , I can not find your question on the forum (http://answers.opencv.org). Did you try to ask it there?

dxqxiaoqiang commented 7 years ago

I have solved my problem.Thanks. @msandler

sxk000 commented 7 years ago

i have get into this trouble recently,and i didn't get right answer to this problem,could you tell me how to solved this problem? thanks @dxqxiaoqiang

mmfrxx commented 5 years ago

@dxqxiaoqiang I have the same issue now.Could you please tell how did you solve it?

prachikashikar commented 5 years ago

@dxqxiaoqiang Please tell your approch....

GRASBOCK commented 4 years ago

One solution is to set the OpenCV_DIR system environment variable to the directory where the "OpenCVConfig.cmake" or "opencv-config.cmake" is placed. For my install it was: "C:\opencv\build"

phoenixrider12 commented 2 years ago

How did you solve this problem @dxqxiaoqiang

sahinboga commented 2 years ago

@GRASBOCK Can you help me please?

CMake Warning at C:/Users/impark/Documents/react-native-optic/cpp/opencv/build/OpenCVConfig.cmake:190 (message): Found OpenCV Windows Pack but it has no binaries compatible with your configuration.

You should manually point CMake variable OpenCV_DIR to your build of OpenCV library.

Call Stack (most recent call first): CMakeLists.txt:8 (find_package) CMake Error at CMakeLists.txt:8 (find_package): Found package configuration file: C:/Users/impark/Documents/react-native-optic/android/../cpp/opencv/build/OpenCVConfig.cmake but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be NOT FOUND.

CMakeList.txt

project(cpp)
cmake_minimum_required(VERSION 3.4.1)
set (CMAKE_VERBOSE_MAKEFILE ON)
set (CMAKE_CXX_STANDARD 11)

SET("OpenCV_DIR" "../cpp/opencv/build")
find_library(PATH ${OpenCV_DIR})

add_library(cpp            
            SHARED
            ../cpp/react-native-optic.cpp
            ../cpp/cv/opticReader.cpp
            ../cpp/cv/base64/base64.cpp
            cpp-adapter.cpp
)

find_package( OpenCV REQUIRED)

target_include_directories(
    cpp
    PRIVATE
    ../cpp/opencv/build/include
)

# Specifies a path to native header files.
include_directories(
            ../cpp
            ../cpp/cv
            ../cpp/cv/base64
            ../cpp/opencv/build/include
)
target_link_libraries(cpp PUBLIC
 ${OpenCV_LIBS} )
sahinboga commented 2 years ago

Can you help me please?

Execution failed for task ':react-native-optic:buildCMakeDebug[arm64-v8a]'.
> Build command failed.
  Error while executing process C:\Users\impark\AppData\Local\Android\Sdk\cmake\3.18.1\bin\ninja.exe with arguments {-C C:\Users\impark\Documents\react-native-optic\android\.cxx\Debug\u5n1l3u3\arm64-v8a cpp}
  ninja: Entering directory `C:\Users\impark\Documents\react-native-optic\android\.cxx\Debug\u5n1l3u3\arm64-v8a'
  [1/5] Building CXX object CMakeFiles/cpp.dir/C_/Users/impark/Documents/react-native-optic/cpp/react-native-optic.cpp.o
  [2/5] Building CXX object CMakeFiles/cpp.dir/C_/Users/impark/Documents/react-native-optic/cpp/cv/base64/base64.cpp.o
  [3/5] Building CXX object CMakeFiles/cpp.dir/cpp-adapter.cpp.o
  [4/5] Building CXX object CMakeFiles/cpp.dir/C_/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp.o
  [5/5] Linking CXX shared library ..\..\..\..\build\intermediates\cxx\Debug\u5n1l3u3\obj\arm64-v8a\libcpp.so
  FAILED: ../../../../build/intermediates/cxx/Debug/u5n1l3u3/obj/arm64-v8a/libcpp.so
  cmd.exe /C "cd . && C:\Users\impark\AppData\Local\Android\Sdk\ndk\21.4.7075529\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=aarch64-none-linux-android21 --gcc-toolchain=C:/Users/impark/AppData/Local/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=C:/Users/impark/AppData/Local/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/windows-x86_64/sysroot -fPIC -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security  -O2 -frtti -fexceptions -Wall -fstack-protector-all -O0 -fno-limit-debug-info  -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libgcc_real.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -shared -Wl,-soname,libcpp.so -o ..\..\..\..\build\intermediates\cxx\Debug\u5n1l3u3\obj\arm64-v8a\libcpp.so CMakeFiles/cpp.dir/C_/Users/impark/Documents/react-native-optic/cpp/react-native-optic.cpp.o CMakeFiles/cpp.dir/C_/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp.o CMakeFiles/cpp.dir/C_/Users/impark/Documents/react-native-optic/cpp/cv/base64/base64.cpp.o CMakeFiles/cpp.dir/cpp-adapter.cpp.o  -latomic -lm && cd ."
  CMakeFiles/cpp.dir/C_/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp.o: In function `__cxx_global_var_init.3':
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:18: undefined reference to `cv::Mat::Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:18: undefined reference to `cv::Mat::~Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:18: undefined reference to `cv::Mat::~Mat()'
  CMakeFiles/cpp.dir/C_/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp.o: In function `__cxx_global_var_init.4':
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:18: undefined reference to `cv::Mat::Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:18: undefined reference to `cv::Mat::~Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:18: undefined reference to `cv::Mat::~Mat()'
  CMakeFiles/cpp.dir/C_/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp.o: In function `__cxx_global_var_init.5':
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:18: undefined reference to `cv::Mat::Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:18: undefined reference to `cv::Mat::~Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:18: undefined reference to `cv::Mat::~Mat()'
  CMakeFiles/cpp.dir/C_/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp.o: In function `reader::base64ToMat(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >)':
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:33: undefined reference to `cv::imdecode(cv::_InputArray const&, int)'
  CMakeFiles/cpp.dir/C_/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp.o: In function `reader::matToBase64(cv::Mat)':
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:38: undefined reference to `cv::imencode(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, cv::_InputArray const&, std::__ndk1::vector<unsigned char, std::__ndk1::allocator<unsigned char> >&, std::__ndk1::vector<int, std::__ndk1::allocator<int> > const&)'
  CMakeFiles/cpp.dir/C_/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp.o: In function `reader::preProcessing(cv::Mat)':
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:48: undefined reference to `cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:49: undefined reference to `cv::adaptiveThreshold(cv::_InputArray const&, cv::_OutputArray const&, double, int, int, int, double)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:50: undefined reference to `cv::GaussianBlur(cv::_InputArray const&, cv::_OutputArray const&, cv::Size_<int>, double, double, int)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:54: undefined reference to `cv::Canny(cv::_InputArray const&, cv::_OutputArray const&, double, double, int, bool)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:55: undefined reference to `cv::getStructuringElement(int, cv::Size_<int>, cv::Point_<int>)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:56: undefined reference to `cv::dilate(cv::_InputArray const&, cv::_OutputArray const&, cv::_InputArray const&, cv::Point_<int>, int, int, cv::Scalar_<double> const&)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:57: undefined reference to `cv::Mat::Mat(cv::Mat const&)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:58: undefined reference to `cv::Mat::~Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:58: undefined reference to `cv::Mat::~Mat()'
  CMakeFiles/cpp.dir/C_/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp.o: In function `reader::getContours(cv::Mat)':
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:65: undefined reference to `cv::findContours(cv::_InputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, int, int, cv::Point_<int>)'
  CMakeFiles/cpp.dir/C_/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp.o: In function `reader::getBiggestContour(std::__ndk1::vector<std::__ndk1::vector<cv::Point_<int>, std::__ndk1::allocator<cv::Point_<int> > >, std::__ndk1::allocator<std::__ndk1::vector<cv::Point_<int>, std::__ndk1::allocator<cv::Point_<int> > > > >)':
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:76: undefined reference to `cv::contourArea(cv::_InputArray const&, bool)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:80: undefined reference to `cv::arcLength(cv::_InputArray const&, bool)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:81: undefined reference to `cv::approxPolyDP(cv::_InputArray const&, cv::_OutputArray const&, double, bool)'
  CMakeFiles/cpp.dir/C_/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp.o: In function `reader::drawPoints(std::__ndk1::vector<cv::Point_<int>, std::__ndk1::allocator<cv::Point_<int> > >, cv::Scalar_<double>)':
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:96: undefined reference to `cv::circle(cv::_InputOutputArray const&, cv::Point_<int>, int, cv::Scalar_<double> const&, int, int, int)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:97: undefined reference to `cv::putText(cv::_InputOutputArray const&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, cv::Point_<int>, 
int, double, cv::Scalar_<double>, int, int, bool)'
  CMakeFiles/cpp.dir/C_/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp.o: In function `reader::getWarp(cv::Mat, std::__ndk1::vector<cv::Point_<int>, std::__ndk1::allocator<cv::Point_<int> > >, float, float)':
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:122: undefined reference to `cv::getPerspectiveTransform(cv::Point_<float> const*, cv::Point_<float> const*, int)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:123: undefined reference to `cv::warpPerspective(cv::_InputArray const&, cv::_OutputArray const&, cv::_InputArray const&, cv::Size_<int>, int, int, cv::Scalar_<double> const&)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:124: undefined reference to `cv::Mat::Mat(cv::Mat const&)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:125: undefined reference to `cv::Mat::~Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:125: undefined reference to `cv::Mat::~Mat()'
  CMakeFiles/cpp.dir/C_/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp.o: In function `reader::findRoiDot(cv::Mat)':
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:138: undefined reference to `cv::Mat::Mat(cv::Mat const&, cv::Rect_<int> const&)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:142: undefined reference to `cv::Mat::Mat(cv::Mat const&)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:142: undefined reference to `cv::Mat::~Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:145: undefined reference to `cv::Mat::Mat(cv::Mat const&)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:145: undefined reference to `cv::Mat::~Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:150: undefined reference to `cv::minAreaRect(cv::_InputArray const&)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:142: undefined reference to `cv::Mat::~Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:145: undefined reference to `cv::Mat::~Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:157: undefined reference to `cv::Mat::~Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:157: undefined reference to `cv::Mat::~Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:157: undefined reference to `cv::Mat::~Mat()'
  CMakeFiles/cpp.dir/C_/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp.o:C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:157: more undefined references to `cv::Mat::~Mat()' follow
  CMakeFiles/cpp.dir/C_/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp.o: In function `reader::fillRects(cv::Mat, std::__ndk1::vector<cv::RotatedRect, std::__ndk1::allocator<cv::RotatedRect> >)':
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:165: undefined reference to `cv::Mat::clone() const'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:173: undefined reference to `cv::rectangle(cv::_InputOutputArray const&, cv::Rect_<int>, cv::Scalar_<double> const&, int, int, int)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:183: undefined reference to `cv::rectangle(cv::_InputOutputArray const&, cv::Rect_<int>, cv::Scalar_<double> const&, int, int, int)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:187: undefined reference to `cv::Mat::~Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:187: undefined reference to `cv::Mat::~Mat()'
  CMakeFiles/cpp.dir/C_/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp.o: In function `reader::getReadableContours(cv::Mat)':
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:202: undefined reference to `cv::Mat::clone() const'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:202: undefined reference to `cv::Mat::~Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:203: undefined reference to `cv::Mat::clone() const'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:207: undefined reference to `cv::minAreaRect(cv::_InputArray const&)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:207: undefined reference to `cv::RotatedRect::boundingRect() const'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:208: undefined reference to `cv::rectangle(cv::_InputOutputArray const&, cv::Point_<int>, cv::Point_<int>, cv::Scalar_<double> const&, int, int, int)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:202: undefined reference to `cv::Mat::~Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:211: undefined reference to `cv::Mat::~Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:211: undefined reference to `cv::Mat::~Mat()'
  CMakeFiles/cpp.dir/C_/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp.o: In function `reader::isFill(cv::Mat, int, int)':
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:215: undefined reference to `cv::Mat::clone() const'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:216: undefined reference to `cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:217: undefined reference to `cv::threshold(cv::_InputArray const&, cv::_OutputArray const&, double, double, int)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:218: undefined reference to `cv::circle(cv::_InputOutputArray const&, cv::Point_<int>, int, cv::Scalar_<double> const&, int, int, int)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:221: undefined reference to `cv::Mat::Mat(cv::Mat const&, cv::Rect_<int> const&)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:234: undefined reference to `cv::Mat::~Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:234: undefined reference to `cv::Mat::~Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:234: undefined reference to `cv::Mat::~Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:234: undefined reference to `cv::Mat::~Mat()'
  CMakeFiles/cpp.dir/C_/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp.o: In function `reader::run(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >)':
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:239: undefined reference to `cv::Mat::operator=(cv::Mat&&)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:239: undefined reference to `cv::Mat::~Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:240: undefined reference to `cv::resize(cv::_InputArray const&, cv::_OutputArray const&, cv::Size_<int>, double, double, int)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:242: undefined reference to `cv::Mat::Mat(cv::Mat const&)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:242: undefined reference to `cv::Mat::operator=(cv::Mat&&)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:242: undefined reference to `cv::Mat::~Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:242: undefined reference to `cv::Mat::~Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:244: undefined reference to `cv::Mat::Mat(cv::Mat const&)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:244: undefined reference to `cv::Mat::~Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:249: undefined reference to `cv::Mat::Mat(cv::Mat const&)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:249: undefined reference to `cv::Mat::operator=(cv::Mat&&)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:249: undefined reference to `cv::Mat::~Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:249: undefined reference to `cv::Mat::~Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:250: undefined reference to `cv::Mat::Mat(cv::Mat const&)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:250: undefined reference to `cv::Mat::~Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:252: undefined reference to `cv::Mat::Mat(cv::Mat const&)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:252: undefined reference to `cv::Mat::~Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:254: undefined reference to `cv::Mat::Mat(cv::Mat const&)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:254: undefined reference to `cv::Mat::~Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:260: undefined reference to `cv::Mat::Mat(cv::Mat const&)'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:260: undefined reference to `cv::Mat::~Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:261: undefined reference to `cv::Mat::~Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:239: undefined reference to `cv::Mat::~Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:242: undefined reference to `cv::Mat::~Mat()'
  C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:242: undefined reference to `cv::Mat::~Mat()'
  CMakeFiles/cpp.dir/C_/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp.o:C:/Users/impark/Documents/react-native-optic/cpp/cv/opticReader.cpp:244: more undefined references to `cv::Mat::~Mat()' follow
  clang++: error: linker command failed with exit code 1 (use -v to see invocation)
  ninja: build stopped: subcommand failed.
GRASBOCK commented 2 years ago

@sahinboga I rarely use c++ nowadays and just switched to languages with better package managers. I also didn't learn much in the cmake domain since then. So I cannot help anyone regarding theses issues.

babatunde-ayoade commented 1 year ago

How did you solve this problem @dxqxiaoqiang

A bit simple. What I did that worked was:

(1) Edit your CMakeLists.txt and arrange it this way set(OpenCV_DIR /home/dxq/opencv/build) find_package( OpenCV REQUIRED )

(2)create a FindOpenCV.cmake file in ~/opencv/cmake directory

cd into /home/dxq/opencv/cmake nano FindOpenCV.cmake

(3) Load FindOpenCV.make Go to https://github.com/STEllAR-GROUP/libgeodecomp/blob/master/CMakeModules/FindOpenCV.cmake

Copy the content in the url above and save in the FindOpenCV.cmake

This work for me.

furuichii-dono commented 10 months ago

Useless product. If a person has to spend hours just to use this worthless product why make it.