推荐使用mingw-w64的gcc编译,安装时提供32和64位编译器,用mingw的gcc编译容易出错
博客主页:http://blog.csdn.net/xs1102
文章地址:https://blog.csdn.net/xs1102/article/details/80931204
本文内容为收集而成,有些杂乱。
minGW\bin\windres.exe: invalid option -- W
解决这个问题,下面CMake option: ENABLE_PRECOMPILED_HEADERS=OFF
就这个了,好像也有提供cmake补丁的,或者cmake降级的
" 'strdup' was not declared in this scope "
函数名: strdup; 功能: 将串拷贝到新建的位置处; 用法: char *strdup(char *str);
strdup属于GNU C++的函数, 不是标准(std)C++的函数, 需要修改参数:
把"-std=c++11"修改为"-std=gnu++0x", 即可.
PATH_MAX未定义
直接在源文件定义一个#define PATH_MAX 260
error: 'thread' in namespace 'std' does not name a type
安装mingw-w64时,需要选择poixs线程的,win32的会报错。可以通过重装mingw解决。
modules\videoio\src\cap_dshow.cpp:2145:41: error: 'sprintf_instead_use_StringCbPrintfA_or_StringCchPrintfA' was not declared in this scope
if( type == MEDIASUBTYPE_RGB24) sprintf(tmpStr, "RGB24");
#define STRSAFE_NO_DEPRECATE
.obj: too many sections (33396)
You need to pass -Wa,-mbig-obj
to gcc
to opt-in to big objects (-Wa
means pass this option to the assembler)