Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Not able to build OpenCV3-RC1 with 'Debug' build type

Hi,

I have problems to build OpenCV3-RC1 with the Debug build type activated. I was able to build a normal shared library version, but with debug mode I get the following:

error: 'sprintf_instead_use_StringCbPrintfA_or_StringCchPrintfA' was not declared in this scope

My compiler is 'mingw-w64 4.9.2 posix sjlj'.

Extract from the log:

    [  2%] [  9%] Built target zlib
Built target libjpeg
[ 18%] [ 23%] Built target libwebp
Built target libjasper
[ 23%] Built target opencv_ts_pch_dephelp
[ 26%] [ 32%] Built target libpng
[ 42%] Built target libtiff
Built target IlmImf
[ 42%] Built target pch_Generate_opencv_ts
[ 42%] Building CXX object modules/world/CMakeFiles/opencv_world.dir/__/videoio/src/cap_dshow.cpp.obj
[ 42%] [ 43%] Building CXX object modules/world/CMakeFiles/opencv_world.dir/__/features2d/src/dynamic.cpp.obj
Building CXX object modules/world/CMakeFiles/opencv_world.dir/__/features2d/src/evaluation.cpp.obj
[ 43%] Building CXX object modules/world/CMakeFiles/opencv_world.dir/__/features2d/src/fast.cpp.obj
[ 43%] Building CXX object modules/world/CMakeFiles/opencv_world.dir/__/features2d/src/fast_score.cpp.obj
In file included from D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:332:0:
D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp: In member function 'void videoInput::getMediaSubtypeAsString(GUID, char*)':
D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:2178:41: error: 'sprintf_instead_use_StringCbPrintfA_or_StringCchPrintfA' was not declared in this scope
     if( type == MEDIASUBTYPE_RGB24)     sprintf(tmpStr, "RGB24");
                                         ^
D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:2178:57: warning: left operand of comma operator has no effect [-Wunused-value]
     if( type == MEDIASUBTYPE_RGB24)     sprintf(tmpStr, "RGB24");
                                                         ^
D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:2179:5: error: 'else' without a previous 'if'
     else if(type == MEDIASUBTYPE_RGB32) sprintf(tmpStr, "RGB32");
     ^
In file included from D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:332:0:
D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:2179:41: error: 'sprintf_instead_use_StringCbPrintfA_or_StringCchPrintfA' was not declared in this scope
     else if(type == MEDIASUBTYPE_RGB32) sprintf(tmpStr, "RGB32");
                                         ^
D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:2179:57: warning: left operand of comma operator has no effect [-Wunused-value]
     else if(type == MEDIASUBTYPE_RGB32) sprintf(tmpStr, "RGB32");
                                                         ^
D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:2180:5: error: 'else' without a previous 'if'
     else if(type == MEDIASUBTYPE_RGB555)sprintf(tmpStr, "RGB555");
     ^
In file included from D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:332:0:
D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:2180:41: error: 'sprintf_instead_use_StringCbPrintfA_or_StringCchPrintfA' was not declared in this scope
     else if(type == MEDIASUBTYPE_RGB555)sprintf(tmpStr, "RGB555");
                                         ^
D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:2180:57: warning: left operand of comma operator has no effect [-Wunused-value]
     else if(type == MEDIASUBTYPE_RGB555)sprintf(tmpStr, "RGB555");
                                                         ^
D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:2181:5: error: 'else' without a previous 'if'
     else if(type == MEDIASUBTYPE_RGB565)sprintf(tmpStr, "RGB565");
     ^
In file included from D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:332:0:
D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:2181:41: error: 'sprintf_instead_use_StringCbPrintfA_or_StringCchPrintfA' was not declared in this scope
     else if(type == MEDIASUBTYPE_RGB565)sprintf(tmpStr, "RGB565");
                                         ^
D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:2181:57: warning: left operand of comma operator has no effect [-Wunused-value]
     else if(type == MEDIASUBTYPE_RGB565)sprintf(tmpStr, "RGB565");
                                                         ^
D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:2182:5: error: 'else' without a previous 'if'
     else if(type == MEDIASUBTYPE_YUY2)  sprintf(tmpStr, "YUY2");
     ^
In file included from D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:332:0:
D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:2182:41: error: 'sprintf_instead_use_StringCbPrintfA_or_StringCchPrintfA' was not declared in this scope

...

In file included from D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:332:0:
D:/Programmierung/Compiler/mingw-w64/x32-4.9.2-posix-sjlj-rev2/mingw32/i686-w64-mingw32/include/strsafe.h: At global scope:
D:/Programmierung/Compiler/mingw-w64/x32-4.9.2-posix-sjlj-rev2/mingw32/i686-w64-mingw32/include/strsafe.h:507:12: warning: inline function 'HRESULT StringCbVPrintfA(STRSAFE_LPSTR, size_t, STRSAFE_LPCSTR, va_list)' used but never defined
 STRSAFEAPI StringCbVPrintfA(STRSAFE_LPSTR pszDest,size_t cbDest,STRSAFE_LPCSTR pszFormat,va_list argList);
            ^
modules\world\CMakeFiles\opencv_world.dir\build.make:4240: recipe for target 'modules/world/CMakeFiles/opencv_world.dir/__/videoio/src/cap_dshow.cpp.obj' failed
mingw32-make[2]: *** [modules/world/CMakeFiles/opencv_world.dir/__/videoio/src/cap_dshow.cpp.obj] Error 1
mingw32-make[2]: *** Waiting for unfinished jobs....
CMakeFiles\Makefile2:1616: recipe for target 'modules/world/CMakeFiles/opencv_world.dir/all' failed
mingw32-make[1]: *** [modules/world/CMakeFiles/opencv_world.dir/all] Error 2
makefile:136: recipe for target 'all' failed
mingw32-make: *** [all] Error 2

Is there something I can do here?

click to hide/show revision 2
retagged

updated 2015-05-26 02:30:58 -0600

berak gravatar image

Not able to build OpenCV3-RC1 with 'Debug' build type

Hi,

I have problems to build OpenCV3-RC1 with the Debug build type activated. I was able to build a normal shared library version, but with debug mode I get the following:

error: 'sprintf_instead_use_StringCbPrintfA_or_StringCchPrintfA' was not declared in this scope

My compiler is 'mingw-w64 4.9.2 posix sjlj'.

Extract from the log:

    [  2%] [  9%] Built target zlib
Built target libjpeg
[ 18%] [ 23%] Built target libwebp
Built target libjasper
[ 23%] Built target opencv_ts_pch_dephelp
[ 26%] [ 32%] Built target libpng
[ 42%] Built target libtiff
Built target IlmImf
[ 42%] Built target pch_Generate_opencv_ts
[ 42%] Building CXX object modules/world/CMakeFiles/opencv_world.dir/__/videoio/src/cap_dshow.cpp.obj
[ 42%] [ 43%] Building CXX object modules/world/CMakeFiles/opencv_world.dir/__/features2d/src/dynamic.cpp.obj
Building CXX object modules/world/CMakeFiles/opencv_world.dir/__/features2d/src/evaluation.cpp.obj
[ 43%] Building CXX object modules/world/CMakeFiles/opencv_world.dir/__/features2d/src/fast.cpp.obj
[ 43%] Building CXX object modules/world/CMakeFiles/opencv_world.dir/__/features2d/src/fast_score.cpp.obj
In file included from D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:332:0:
D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp: In member function 'void videoInput::getMediaSubtypeAsString(GUID, char*)':
D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:2178:41: error: 'sprintf_instead_use_StringCbPrintfA_or_StringCchPrintfA' was not declared in this scope
     if( type == MEDIASUBTYPE_RGB24)     sprintf(tmpStr, "RGB24");
                                         ^
D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:2178:57: warning: left operand of comma operator has no effect [-Wunused-value]
     if( type == MEDIASUBTYPE_RGB24)     sprintf(tmpStr, "RGB24");
                                                         ^
D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:2179:5: error: 'else' without a previous 'if'
     else if(type == MEDIASUBTYPE_RGB32) sprintf(tmpStr, "RGB32");
     ^
In file included from D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:332:0:
D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:2179:41: error: 'sprintf_instead_use_StringCbPrintfA_or_StringCchPrintfA' was not declared in this scope
     else if(type == MEDIASUBTYPE_RGB32) sprintf(tmpStr, "RGB32");
                                         ^
D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:2179:57: warning: left operand of comma operator has no effect [-Wunused-value]
     else if(type == MEDIASUBTYPE_RGB32) sprintf(tmpStr, "RGB32");
                                                         ^
D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:2180:5: error: 'else' without a previous 'if'
     else if(type == MEDIASUBTYPE_RGB555)sprintf(tmpStr, "RGB555");
     ^
In file included from D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:332:0:
D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:2180:41: error: 'sprintf_instead_use_StringCbPrintfA_or_StringCchPrintfA' was not declared in this scope
     else if(type == MEDIASUBTYPE_RGB555)sprintf(tmpStr, "RGB555");
                                         ^
D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:2180:57: warning: left operand of comma operator has no effect [-Wunused-value]
     else if(type == MEDIASUBTYPE_RGB555)sprintf(tmpStr, "RGB555");
                                                         ^
D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:2181:5: error: 'else' without a previous 'if'
     else if(type == MEDIASUBTYPE_RGB565)sprintf(tmpStr, "RGB565");
     ^
In file included from D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:332:0:
D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:2181:41: error: 'sprintf_instead_use_StringCbPrintfA_or_StringCchPrintfA' was not declared in this scope
     else if(type == MEDIASUBTYPE_RGB565)sprintf(tmpStr, "RGB565");
                                         ^
D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:2181:57: warning: left operand of comma operator has no effect [-Wunused-value]
     else if(type == MEDIASUBTYPE_RGB565)sprintf(tmpStr, "RGB565");
                                                         ^
D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:2182:5: error: 'else' without a previous 'if'
     else if(type == MEDIASUBTYPE_YUY2)  sprintf(tmpStr, "YUY2");
     ^
In file included from D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:332:0:
D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:2182:41: error: 'sprintf_instead_use_StringCbPrintfA_or_StringCchPrintfA' was not declared in this scope

...

In file included from D:\Programmierung\Bibliotheken\OpenCV\3.0.0-rc1\opencv\sources\modules\videoio\src\cap_dshow.cpp:332:0:
D:/Programmierung/Compiler/mingw-w64/x32-4.9.2-posix-sjlj-rev2/mingw32/i686-w64-mingw32/include/strsafe.h: At global scope:
D:/Programmierung/Compiler/mingw-w64/x32-4.9.2-posix-sjlj-rev2/mingw32/i686-w64-mingw32/include/strsafe.h:507:12: warning: inline function 'HRESULT StringCbVPrintfA(STRSAFE_LPSTR, size_t, STRSAFE_LPCSTR, va_list)' used but never defined
 STRSAFEAPI StringCbVPrintfA(STRSAFE_LPSTR pszDest,size_t cbDest,STRSAFE_LPCSTR pszFormat,va_list argList);
            ^
modules\world\CMakeFiles\opencv_world.dir\build.make:4240: recipe for target 'modules/world/CMakeFiles/opencv_world.dir/__/videoio/src/cap_dshow.cpp.obj' failed
mingw32-make[2]: *** [modules/world/CMakeFiles/opencv_world.dir/__/videoio/src/cap_dshow.cpp.obj] Error 1
mingw32-make[2]: *** Waiting for unfinished jobs....
CMakeFiles\Makefile2:1616: recipe for target 'modules/world/CMakeFiles/opencv_world.dir/all' failed
mingw32-make[1]: *** [modules/world/CMakeFiles/opencv_world.dir/all] Error 2
makefile:136: recipe for target 'all' failed
mingw32-make: *** [all] Error 2

Is there something I can do here?