- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试编译 opencv-3.1.0/samples/gpu/surf_keypoint_matcher.cpp
通过:
g++ -I/usr/local/include/opencv -I/usr/local/include/opencv2 -L/usr/local/lib/-g -o 二进制 surf_keypoint_matcher.cpp -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_stitching -lopencv_imgcodecs -lopencv_xfeatures2d
但是我收到了这个错误:
/tmp/ccQW7t3Z.o: In function `main':
/home/luca/Downloads/opencv-3.1.0/samples/gpu/surf_keypoint_matcher.cpp:65: undefined reference to `cv::cuda::DescriptorMatcher::createBFMatcher(int)'
collect2: error: ld returned 1 exit status
为什么?
最佳答案
您的错误信息:
/home/luca/Downloads/opencv-3.1.0/samples/gpu/surf_keypoint_matcher.cpp:65: undefined reference to `cv::cuda::DescriptorMatcher::createBFMatcher(int)'
collect2: error: ld returned 1 exit status
表明您有一个 undefined reference cv::cuda::DescriptorMatcher::createBFMatcher
这位于 cuda 库中,因此您需要包含适当的 header 并链接到以下库,因为 opencv_cudafeatures2d
取决于它们:
对于我正在使用的 opencv 3.1.0 版来说确实如此
关于c++ - opencv:对 `cv::cuda::DescriptorMatcher::createBFMatcher(int)' 的 undefined reference ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37656085/
我正在尝试编译 opencv-3.1.0/samples/gpu/surf_keypoint_matcher.cpp 通过: g++ -I/usr/local/include/opencv -I/us
我是一名优秀的程序员,十分优秀!