这篇文章包含我(以及其他用户)在从源代码构建库时遇到的所有问题。由于没有教程,因此我决定创建这种常见问题解答帖子,将所有解决方案放在一起。希望能够帮到你!
配置:
OpenCV 3.2.0
MinGW-w64 x86_64-6.1.0-win32-seh-rt_v5-rev0
欢迎在答案中添加更多信息,因为将所有内容放在一个地方更加方便。
欢迎在答案中添加更多信息,因为将所有内容放在一个地方更加方便。
opencv\sources
now contains CMakeLists.txt
and all the other files necessary. Configure the project in CMake. CLion users may just open CMakeLists.txt
.
sprintf ()
family security error.add_definitions(-DSTRSAFE_NO_DEPRECATE)
to the beginning of CMakeLists.txt
. This will define STRSAFE_NO_DEPRECATE
symbol for the project and suppress the error.Fix 2: 'too many sections' as.exe
error.
Add the following lines to the beginning of CMakeLists.txt
(source):
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-Wa,-mbig-obj")
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "-Wa,-mbig-obj")
0x88
instead of mask_lo = _MM_SHUFFLE(2, 0, 2, 0)
(binary 10 00 10 00
) and 0xDD
instead of mask_hi
.thread
s in MinGW.#include <mingw.*.h>
to <mutex>
, <thread>
, <condition_variable>
before #endif // C++11
. (Source)Makefile
.cmd
, cd
to the output folder and call [path to compiler]\mingw32-make.exe install
. (Source)install
folder! Now you can move it to a desired destination and set up environment variables.
dlib
和OpenCV吗? - Jeru Luke