简体   繁体   English

使用 Mingw-make 构建 OpenCV 3.3 给出了 47% 的错误 2

[英]Building OpenCV 3.3 using Mingw-make gives error 2 at 47%

When trying to build OpenCV 3.3.0 with the mingw compiler I keep getting an error.尝试使用 mingw 编译器构建 OpenCV 3.3.0 时,我不断收到错误消息。 First I am using CMake to generate the build files (I choose Mingw makefiles and select the gcc en g++ compilers myself, although using the native compilers gives me the same error at the exact same time).首先,我使用 CMake 生成构建文件(我选择 Mingw makefiles 并自己选择 gcc en g++ 编译器,尽管使用本机编译器同时给了我同样的错误)。 When I then use mingw32-make to build OpenCV I get the following error around 48%:当我然后使用 mingw32-make 构建 OpenCV 时,我在 48% 左右得到以下错误:

 48%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/mathfuncs_core.avx.cpp.obj
[ 48%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/convert.avx2.cpp.obj
[ 48%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/mathfuncs_core.avx2.cpp.obj
[ 48%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/stat.avx2.cpp.obj
[ 48%] Building RC object modules/core/CMakeFiles/opencv_core.dir/vs_version.rc.obj
C:\Qt\Tools\mingw530_32\bin\windres.exe: unknown option -- W
Usage: C:\Qt\Tools\mingw530_32\bin\windres.exe [option(s)] [input-file] [output-file]
 The options are:
  -i --input=<file>            Name input file
  -o --output=<file>           Name output file
  -J --input-format=<format>   Specify input format
  -O --output-format=<format>  Specify output format
  -F --target=<target>         Specify COFF target
     --preprocessor=<program>  Program to use to preprocess rc file
     --preprocessor-arg=<arg>  Additional preprocessor argument
  -I --include-dir=<dir>       Include directory when preprocessing rc file
  -D --define <sym>[=<val>]    Define SYM when preprocessing rc file
  -U --undefine <sym>          Undefine SYM when preprocessing rc file
  -v --verbose                 Verbose - tells you what it's doing
  -c --codepage=<codepage>     Specify default codepage
  -l --language=<val>          Set language when reading rc file
     --use-temp-file           Use a temporary file instead of popen to read
                               the preprocessor output
     --no-use-temp-file        Use popen (default)
  -r                           Ignored for compatibility with rc
  @<file>                      Read options from <file>
  -h --help                    Print this help message
  -V --version                 Print version information
FORMAT is one of rc, res, or coff, and is deduced from the file name
extension if not specified.  A single file name is an input file.
No input-file is stdin, default rc.  No output-file is stdout, default rc.
C:\Qt\Tools\mingw530_32\bin\windres.exe: supported targets: pe-i386 pei-i386 elf32-i386 elf32-little elf32-big plugin srec symbolsrec verilog tekhex binary ihex
modules\core\CMakeFiles\opencv_core.dir\build.make:1641: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/vs_version.rc.obj' failed
mingw32-make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/vs_version.rc.obj] Error 1
mingw32-make[2]: *** Waiting for unfinished jobs....
CMakeFiles\Makefile2:1550: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/all' failed
mingw32-make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
Makefile:159: recipe for target 'all' failed
mingw32-make: *** [all] Error 2

I am quite the novice when it comes to building a library and for some reason building them always seems to fail with me.在构建库方面,我是个新手,出于某种原因,构建它们似乎总是失败。 Can anyone help me?任何人都可以帮助我吗?

- Martijn - 马丁

Maybe this answer can help.也许这个答案可以提供帮助。 Its a problem with cmake and precompiled headers这是 cmake 和预编译头文件的问题

try this : in cmake uncheck ENABLE_PRECOMPILED_HEADERS试试这个:在 cmake 中取消选中 ENABLE_PRECOMPILED_HEADERS

If unchecking ENABLE_PRECOMPILED_HEADERS doesn't work.如果取消选中ENABLE_PRECOMPILED_HEADERS不起作用。 Try this:试试这个:

  1. Add a new entry to CMake向 CMake 添加新条目
  2. Name the entry: OPENCV_ALLOCATOR_STATS_COUNTER_TYPE with Value(String): int64_t将条目命名为: OPENCV_ALLOCATOR_STATS_COUNTER_TYPEValue(String): int64_t
  3. Configure and generate the MAKEFILE配置和生成MAKEFILE
  4. Go to the build directory and execute make install or mingw32-make install进入构建目录并执行make installmingw32-make install

If you want more info of your compilation log, you can run make install VERBOSE=1如果您想了解编译日志的更多信息,可以运行make install VERBOSE=1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM