我已经从网站下载了最新的 OpenCV 版本(2.4.2)。我计划为 MinGW 使用最新的 g++ 编译器,即 4.7.1 版。最后一天我一直在尝试编译在以下位置找到的演示: http: //docs.opencv.org/trunk/doc/tutorials/introduction/linux_gcc_cmake/linux_gcc_cmake.html。
现在我在一台 Windows 机器上并通过可执行文件安装它,但我看不出在这种情况下会有什么不同。
我的 CMakeLists.txt 看起来像:
project( DisplayImage )
cmake_minimum_required(VERSION 2.8)
SET("OpenCV_DIR" "D:/__dev/opencv/build")
find_package( OpenCV REQUIRED )
add_executable( DisplayImage DisplayImage )
target_link_libraries( DisplayImage ${OpenCV_LIBS} )
现在,当我编译示例时,我不断收到以下错误:
[100%] Building CXX object CMakeFiles/DisplayImage.dir/DisplayImage.cpp.obj
In file included from D:/__dev/opencv/build/include/opencv2/flann/lsh_index.h:49:0,
from D:/__dev/opencv/build/include/opencv2/flann/all_indices.h:42,
from D:/__dev/opencv/build/include/opencv2/flann/flann_base.hpp:44,
from D:/__dev/opencv/build/include/opencv2/flann/flann.hpp:50,
from D:/__dev/opencv/build/include/opencv\cv.h:69,
from C:\cv_test\DisplayImage.cpp:1:
D:/__dev/opencv/build/include/opencv2/flann/lsh_table.h: In member function 'void cvflann::lsh::LshTable<ElementType>::add(cvflann
::Matrix<T>)':
D:/__dev/opencv/build/include/opencv2/flann/lsh_table.h:196:14: error: 'use_speed_' was not declared in this scope
make[2]: *** [CMakeFiles/DisplayImage.dir/DisplayImage.cpp.obj] Error 1
make[1]: *** [CMakeFiles/DisplayImage.dir/all] Error 2
make: *** [all] Error 2
我知道错误的含义,但无法弄清楚我的问题。