Я пытаюсь собрать OpenCV
из источника, используя TDM MinGW (5.1.0)
, поставляемый вместе с code blocks (32 bit)
и CMake
, при выполнении mingw32-make
Я получаю io_win32.cc : _wfopen has not been declared
ошибку.
[ 0%] Built target gen-pkgconfig
[ 2%] Built target zlib
[ 5%] Built target libjpeg-turbo
[ 7%] Built target libtiff
[ 15%] Built target libwebp
[ 18%] Built target libjasper
[ 19%] Built target libpng
[ 24%] Built target IlmImf
[ 24%] Building CXX object 3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/stubs/io_win32.cc.obj
D:\Programs\OpenCV-Source\opencv\3rdparty\protobuf\src\google\protobuf\stubs\io_win32.cc: In function 'FILE* google::protobuf::internal::win32::fopen(const char*, const char*)':
D:\Programs\OpenCV-Source\opencv\3rdparty\protobuf\src\google\protobuf\stubs\io_win32.cc:330:10: error: '::_wfopen' has not been declared
return ::_wfopen(wpath.c_str(), wmode.c_str());
^
3rdparty\protobuf\CMakeFiles\libprotobuf.dir\build.make:258: recipe for target '3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/stubs/io_win32.cc.obj' failed
mingw32-make[2]: *** [3rdparty/protobuf/CMakeFiles/libprotobuf.dir/src/google/protobuf/stubs/io_win32.cc.obj] Error 1
CMakeFiles\Makefile2:715: recipe for target '3rdparty/protobuf/CMakeFiles/libprotobuf.dir/all' failed
mingw32-make[1]: *** [3rdparty/protobuf/CMakeFiles/libprotobuf.dir/all] Error 2
Makefile:161: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
Пройдя некоторое время в поиске, я нашел эту ссылку , которая указала, что wfopen
определена в wchar.h
#ifdef __MSVCRT__
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW fgetws (wchar_t*, int, FILE*);
_CRTIMP int __cdecl __MINGW_NOTHROW fputws (const wchar_t*, FILE*);
_CRTIMP wint_t __cdecl __MINGW_NOTHROW getwc (FILE*);
_CRTIMP wint_t __cdecl __MINGW_NOTHROW getwchar (void);
_CRTIMP wint_t __cdecl __MINGW_NOTHROW putwc (wint_t, FILE*);
_CRTIMP wint_t __cdecl __MINGW_NOTHROW putwchar (wint_t);
#ifndef __STRICT_ANSI__
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _getws (wchar_t*);
_CRTIMP int __cdecl __MINGW_NOTHROW _putws (const wchar_t*);
_CRTIMP FILE* __cdecl __MINGW_NOTHROW _wfdopen(int, const wchar_t *);
_CRTIMP FILE* __cdecl __MINGW_NOTHROW _wfopen (const wchar_t*, const wchar_t*);
_CRTIMP FILE* __cdecl __MINGW_NOTHROW _wfreopen (const wchar_t*, const wchar_t*, FILE*);
_CRTIMP FILE* __cdecl __MINGW_NOTHROW _wfsopen (const wchar_t*, const wchar_t*, int);
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wtmpnam (wchar_t*);
_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wtempnam (const wchar_t*, const wchar_t*);
_CRTIMP int __cdecl __MINGW_NOTHROW _wrename (const wchar_t*, const wchar_t*);
_CRTIMP int __cdecl __MINGW_NOTHROW _wremove (const wchar_t*);
_CRTIMP void __cdecl __MINGW_NOTHROW _wperror (const wchar_t*);
_CRTIMP FILE* __cdecl __MINGW_NOTHROW _wpopen (const wchar_t*, const wchar_t*);
#endif /* __STRICT_ANSI__ */
#endif /* __MSVCRT__ */
Я не уверен, как и где добавить это -U__STRICT_ANSI__
Вариант, о котором они говорят в ссылке.В любом случае, кто-нибудь может помочь мне решить эту проблему?Любая помощь будет оценена.