Ask Your Question

Revision history [back]

Building OpenCV Visual Studio 14 2015 Unicode Errors

I am trying to build OpenCV with Visual Studio 2015 and am unable to do so. This was done by pulling the git repository. Nothing fancy here, no CUDA, no contrib, etc. This is something I have done multiple times in the past but this time I am getting weird unicode conversion errors such as:

opencv-master\modules\core\src\glob.cpp(117): error C2664: 'BOOL FindNextFileA(HANDLE,LPWIN32_FIND_DATAA)': cannot convert argument 2 from 'WIN32_FIND_DATA *' to 'LPWIN32_FIND_DATAA'

and

opencv-master\modules\videoio\src\cap_vfw.cpp(165): error C2664: 'HRESULT AVIFileOpenW(PAVIFILE *,LPCWSTR,UINT,LPCLSID)': cannot convert argument 2 from 'const char *' to 'LPCWSTR'

I have turned CV_ENABLE_INTRINSICS off in the cmake configuration as this seems to be a problem at the moment.

So why build OpenCV when I can just download the binaries you say... Well I was trying to compile with CUDA and the contrib libraries, but I had these same problems...

Anyone know the answer here? This is a new install of Visual Studio 2015, so this definitely could be me at fault.

Building OpenCV Visual Studio 14 2015 Unicode Errors

I am trying to build OpenCV with Visual Studio 2015 and am unable to do so. This was done by pulling the git repository. Nothing fancy here, no CUDA, no contrib, etc. This is something I have done multiple times in the past but this time I am getting weird unicode conversion errors such as:

opencv-master\modules\core\src\glob.cpp(117): error C2664: 'BOOL FindNextFileA(HANDLE,LPWIN32_FIND_DATAA)': cannot convert argument 2 from 'WIN32_FIND_DATA *' to 'LPWIN32_FIND_DATAA'

and

opencv-master\modules\videoio\src\cap_vfw.cpp(165): error C2664: 'HRESULT AVIFileOpenW(PAVIFILE *,LPCWSTR,UINT,LPCLSID)': cannot convert argument 2 from 'const char *' to 'LPCWSTR'

I have turned CV_ENABLE_INTRINSICS off in the cmake configuration as this seems to be a problem at the moment.

So why build OpenCV when I can just download the binaries you say... Well I was trying to compile with CUDA and the contrib libraries, but I had these same problems...

Anyone know the answer here? This is a new install of Visual Studio 2015, so this definitely could be me at fault.

Edit: I do realise the git version is 3.3

CMake Output:

found Intel IPP (ICV version): 2017.0.2 [2017.0.2] at: C:/Users/USER/Development/3RD_PARTY/opencv-3.2/opencv-master/build/3rdparty/ippicv/ippicv_win found Intel IPP IW binaries: 2017.0.2 at: C:/Users/USER/Development/3RD_PARTY/opencv-3.2/opencv-master/build/3rdparty/ippicv/ippicv_win/../ippiw_win/ Could not find OpenBLAS include. Turning OpenBLAS_FOUND off Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off A library with BLAS API not found. Please specify library location. LAPACK requires BLAS A library with LAPACK API not found. Please specify library location. Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) Found JNI: C:/Program Files/Java/jdk1.8.0_141/lib/jawt.lib
Excluding from source files list (optimization is disabled): C:/Users/USER/Development/3RD_PARTY/opencv-3.2/opencv-master/modules/core/src/convert.avx2.cpp Excluding from source files list (optimization is disabled): C:/Users/USER/Development/3RD_PARTY/opencv-3.2/opencv-master/modules/core/src/convert.fp16.cpp Excluding from source files list (optimization is disabled): C:/Users/USER/Development/3RD_PARTY/opencv-3.2/opencv-master/modules/core/src/convert.sse4_1.cpp Excluding from source files list (optimization is disabled): C:/Users/USER/Development/3RD_PARTY/opencv-3.2/opencv-master/modules/imgproc/src/corner.avx.cpp Excluding from source files list (optimization is disabled): C:/Users/USER/Development/3RD_PARTY/opencv-3.2/opencv-master/modules/imgproc/src/filter.avx2.cpp Excluding from source files list (optimization is disabled): C:/Users/USER/Development/3RD_PARTY/opencv-3.2/opencv-master/modules/imgproc/src/imgwarp.avx2.cpp Excluding from source files list (optimization is disabled): C:/Users/USER/Development/3RD_PARTY/opencv-3.2/opencv-master/modules/imgproc/src/imgwarp.sse4_1.cpp Excluding from source files list (optimization is disabled): C:/Users/USER/Development/3RD_PARTY/opencv-3.2/opencv-master/modules/imgproc/src/undistort.avx2.cpp Excluding from source files list (optimization is disabled): C:/Users/USER/Development/3RD_PARTY/opencv-3.2/opencv-master/modules/objdetect/src/haar.avx.cpp Torch importer has been enabled. To run the tests you have to install Torch ('th' executable should be available) and generate testdata using opencv_extra/testdata/dnn/generate_torch_models.py script.

General configuration for OpenCV 3.3.0-rc ===================================== Version control: unknown

Platform: Timestamp: 2017-07-25T14:27:57Z Host: Windows 10.0.15063 AMD64 CMake: 3.9.0-rc5 CMake generator: Visual Studio 14 2015 Win64 CMake build tool: C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe MSVC: 1900

CPU/HW features: Baseline: SSE SSE2 SSE3 requested: SSE3 Dispatched code generation: SSE4_1 SSE4_2 FP16 AVX AVX2 requested: SSE4_1 SSE4_2 AVX FP16 AVX2 SSE4_1 (0 files): + SSSE3 SSE4_1 SSE4_2 (0 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 (0 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX AVX (0 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVX AVX2 (0 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2

C/C++: Built as dynamic libs?: YES C++11: YES C++ Compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe (ver 19.0.24215.1) C++ flags (Release): /DWIN32 /D_WINDOWS /W4 /GR /EHa /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /wd4251 /wd4324 /wd4275 /wd4589 /MP8 /MD /O2 /Ob2 /DNDEBUG /Zi C++ flags (Debug): /DWIN32 /D_WINDOWS /W4 /GR /EHa /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /wd4251 /wd4324 /wd4275 /wd4589 /MP8 /MDd /Zi /Ob0 /Od /RTC1 C Compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe C flags (Release): /DWIN32 /D_WINDOWS /W3 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /MP8 /MD /O2 /Ob2 /DNDEBUG /Zi C flags (Debug): /DWIN32 /D_WINDOWS /W3 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /MP8 /MDd /Zi /Ob0 /Od /RTC1 Linker flags (Release): /machine:x64 /INCREMENTAL:NO /debug Linker flags (Debug): /machine:x64 /debug /INCREMENTAL ccache: NO Precompiled headers: NO Extra dependencies: comctl32 gdi32 ole32 setupapi ws2_32 Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Test Qt5::Concurrent Qt5::OpenGL vfw32 glu32 opengl32 3rdparty dependencies:

OpenCV modules: To be built: core flann imgproc ml objdetect photo video dnn imgcodecs shape videoio highgui superres ts features2d calib3d stitching videostab Disabled: world Disabled by dependency: - Unavailable: cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev java python2 python3 viz

Windows RT support: NO

GUI: QT 5.x: YES (ver 5.9.1) QT OpenGL support: YES (Qt5::OpenGL 5.9.1) OpenGL support: YES (glu32 opengl32) VTK support: NO

Media I/O: ZLib: build (ver 1.2.8) JPEG: build (ver 90) WEBP: build (ver encoder: 0x020e) PNG: build (ver 1.6.24) TIFF: build (ver 42 - 4.0.2) JPEG 2000: build (ver 1.900.1) OpenEXR: build (ver 1.7.1) GDAL: NO GDCM: NO

Video I/O: Video for Windows: YES DC1394 1.x: NO DC1394 2.x: NO FFMPEG: YES (prebuilt binaries) avcodec: YES (ver 57.89.100) avformat: YES (ver 57.71.100) avutil: YES (ver 55.58.100) swscale: YES (ver 4.6.100) avresample: YES (ver 3.5.0) GStreamer: NO OpenNI: NO OpenNI PrimeSensor Modules: NO OpenNI2: NO PvAPI: NO GigEVisionSDK: NO DirectShow: YES Media Foundation: NO XIMEA: NO Intel PerC: NO

Parallel framework: Concurrency

Other third-party libraries: Use Intel IPP: 2017.0.2 [2017.0.2] at: C:/Users/USER/Development/3RD_PARTY/opencv-3.2/opencv-master/build/3rdparty/ippicv/ippicv_win Use Intel IPP IW: prebuilt binaries (2017.0.2) Use Intel IPP Async: NO Use Lapack: NO Use Eigen: YES (ver 3.3.4) Use Cuda: NO Use OpenCL: YES Use OpenVX: NO Use custom HAL: NO

OpenCL: <dynamic loading="" of="" opencl="" library=""> Include path: C:/Users/USER/Development/3RD_PARTY/opencv-3.2/opencv-master/3rdparty/include/opencl/1.2 Use AMDFFT: NO Use AMDBLAS: NO

Python 2: Interpreter: C:/Anaconda3_64bit/envs/python2k/python.exe (ver 2.7.13)

Python 3: Interpreter: C:/Anaconda3_64bit/envs/python3k/python.exe (ver 3.6.1)

Python (for build): C:/Anaconda3_64bit/envs/python2k/python.exe

Java: ant: NO JNI: C:/Program Files/Java/jdk1.8.0_141/include C:/Program Files/Java/jdk1.8.0_141/include/win32 C:/Program Files/Java/jdk1.8.0_141/include Java wrappers: NO Java tests: NO

Matlab: NO

Documentation: Doxygen: NO

Tests and samples: Tests: YES Performance tests: YES C/C++ Examples: NO

Install path: C:/Users/USER/Development/3RD_PARTY/opencv-3.2.0_vc14_64

cvconfig.h is in: C:/Users/USER/Development/3RD_PARTY/opencv-3.2/opencv-master/build

click to hide/show revision 3
No.3 Revision

updated 2017-07-25 09:42:48 -0600

berak gravatar image

Building OpenCV Visual Studio 14 2015 Unicode Errors

I am trying to build OpenCV with Visual Studio 2015 and am unable to do so. This was done by pulling the git repository. Nothing fancy here, no CUDA, no contrib, etc. This is something I have done multiple times in the past but this time I am getting weird unicode conversion errors such as:

opencv-master\modules\core\src\glob.cpp(117): error C2664: 'BOOL FindNextFileA(HANDLE,LPWIN32_FIND_DATAA)': cannot convert argument 2 from 'WIN32_FIND_DATA *' to 'LPWIN32_FIND_DATAA'

'LPWIN32_FIND_DATAA'

and

opencv-master\modules\videoio\src\cap_vfw.cpp(165): error C2664: 'HRESULT AVIFileOpenW(PAVIFILE *,LPCWSTR,UINT,LPCLSID)': cannot convert argument 2 from 'const char *' to 'LPCWSTR'

'LPCWSTR'

I have turned CV_ENABLE_INTRINSICS off in the cmake configuration as this seems to be a problem at the moment.

So why build OpenCV when I can just download the binaries you say... Well I was trying to compile with CUDA and the contrib libraries, but I had these same problems...

Anyone know the answer here? This is a new install of Visual Studio 2015, so this definitely could be me at fault.

Edit: I do realise the git version is 3.3

CMake Output:

found Intel IPP (ICV version): 2017.0.2 [2017.0.2]
at: C:/Users/USER/Development/3RD_PARTY/opencv-3.2/opencv-master/build/3rdparty/ippicv/ippicv_win
found Intel IPP IW binaries: 2017.0.2
at: C:/Users/USER/Development/3RD_PARTY/opencv-3.2/opencv-master/build/3rdparty/ippicv/ippicv_win/../ippiw_win/
Could not find OpenBLAS include. Turning OpenBLAS_FOUND off
Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
A library with BLAS API not found. Please specify library location.
LAPACK requires BLAS
A library with LAPACK API not found. Please specify library location.
Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
Found JNI: C:/Program Files/Java/jdk1.8.0_141/lib/jawt.lib 
Excluding from source files list (optimization is disabled): C:/Users/USER/Development/3RD_PARTY/opencv-3.2/opencv-master/modules/core/src/convert.avx2.cpp Excluding from source files list (optimization is disabled): C:/Users/USER/Development/3RD_PARTY/opencv-3.2/opencv-master/modules/core/src/convert.fp16.cpp Excluding from source files list (optimization is disabled): C:/Users/USER/Development/3RD_PARTY/opencv-3.2/opencv-master/modules/core/src/convert.sse4_1.cpp Excluding from source files list (optimization is disabled): C:/Users/USER/Development/3RD_PARTY/opencv-3.2/opencv-master/modules/imgproc/src/corner.avx.cpp Excluding from source files list (optimization is disabled): C:/Users/USER/Development/3RD_PARTY/opencv-3.2/opencv-master/modules/imgproc/src/filter.avx2.cpp Excluding from source files list (optimization is disabled): C:/Users/USER/Development/3RD_PARTY/opencv-3.2/opencv-master/modules/imgproc/src/imgwarp.avx2.cpp Excluding from source files list (optimization is disabled): C:/Users/USER/Development/3RD_PARTY/opencv-3.2/opencv-master/modules/imgproc/src/imgwarp.sse4_1.cpp Excluding from source files list (optimization is disabled): C:/Users/USER/Development/3RD_PARTY/opencv-3.2/opencv-master/modules/imgproc/src/undistort.avx2.cpp Excluding from source files list (optimization is disabled): C:/Users/USER/Development/3RD_PARTY/opencv-3.2/opencv-master/modules/objdetect/src/haar.avx.cpp Torch importer has been enabled. To run the tests you have to install Torch ('th' executable should be available) and generate testdata using opencv_extra/testdata/dnn/generate_torch_models.py script.

script. General configuration for OpenCV 3.3.0-rc ===================================== Version control: unknown

unknown Platform: Timestamp: 2017-07-25T14:27:57Z Host: Windows 10.0.15063 AMD64 CMake: 3.9.0-rc5 CMake generator: Visual Studio 14 2015 Win64 CMake build tool: C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe MSVC: 1900

1900 CPU/HW features: Baseline: SSE SSE2 SSE3 requested: SSE3 Dispatched code generation: SSE4_1 SSE4_2 FP16 AVX AVX2 requested: SSE4_1 SSE4_2 AVX FP16 AVX2 SSE4_1 (0 files): + SSSE3 SSE4_1 SSE4_2 (0 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 (0 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX AVX (0 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVX AVX2 (0 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2

AVX2 C/C++: Built as dynamic libs?: YES C++11: YES C++ Compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe (ver 19.0.24215.1) C++ flags (Release): /DWIN32 /D_WINDOWS /W4 /GR /EHa /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /wd4251 /wd4324 /wd4275 /wd4589 /MP8 /MD /O2 /Ob2 /DNDEBUG /Zi C++ flags (Debug): /DWIN32 /D_WINDOWS /W4 /GR /EHa /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /wd4251 /wd4324 /wd4275 /wd4589 /MP8 /MDd /Zi /Ob0 /Od /RTC1 C Compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe C flags (Release): /DWIN32 /D_WINDOWS /W3 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /MP8 /MD /O2 /Ob2 /DNDEBUG /Zi C flags (Debug): /DWIN32 /D_WINDOWS /W3 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /MP8 /MDd /Zi /Ob0 /Od /RTC1 Linker flags (Release): /machine:x64 /INCREMENTAL:NO /debug Linker flags (Debug): /machine:x64 /debug /INCREMENTAL ccache: NO Precompiled headers: NO Extra dependencies: comctl32 gdi32 ole32 setupapi ws2_32 Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Test Qt5::Concurrent Qt5::OpenGL vfw32 glu32 opengl32 3rdparty dependencies:

dependencies: OpenCV modules: To be built: core flann imgproc ml objdetect photo video dnn imgcodecs shape videoio highgui superres ts features2d calib3d stitching videostab Disabled: world Disabled by dependency: - Unavailable: cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev java python2 python3 viz

viz Windows RT support: NO

NO GUI: QT 5.x: YES (ver 5.9.1) QT OpenGL support: YES (Qt5::OpenGL 5.9.1) OpenGL support: YES (glu32 opengl32) VTK support: NO

NO Media I/O: ZLib: build (ver 1.2.8) JPEG: build (ver 90) WEBP: build (ver encoder: 0x020e) PNG: build (ver 1.6.24) TIFF: build (ver 42 - 4.0.2) JPEG 2000: build (ver 1.900.1) OpenEXR: build (ver 1.7.1) GDAL: NO GDCM: NO

NO Video I/O: Video for Windows: YES DC1394 1.x: NO DC1394 2.x: NO FFMPEG: YES (prebuilt binaries) avcodec: YES (ver 57.89.100) avformat: YES (ver 57.71.100) avutil: YES (ver 55.58.100) swscale: YES (ver 4.6.100) avresample: YES (ver 3.5.0) GStreamer: NO OpenNI: NO OpenNI PrimeSensor Modules: NO OpenNI2: NO PvAPI: NO GigEVisionSDK: NO DirectShow: YES Media Foundation: NO XIMEA: NO Intel PerC: NO

NO Parallel framework: Concurrency

Concurrency Other third-party libraries: Use Intel IPP: 2017.0.2 [2017.0.2] at: C:/Users/USER/Development/3RD_PARTY/opencv-3.2/opencv-master/build/3rdparty/ippicv/ippicv_win Use Intel IPP IW: prebuilt binaries (2017.0.2) Use Intel IPP Async: NO Use Lapack: NO Use Eigen: YES (ver 3.3.4) Use Cuda: NO Use OpenCL: YES Use OpenVX: NO Use custom HAL: NO

NO OpenCL: <dynamic loading="" of="" opencl="" library=""> <Dynamic loading of OpenCL library> Include path: C:/Users/USER/Development/3RD_PARTY/opencv-3.2/opencv-master/3rdparty/include/opencl/1.2 Use AMDFFT: NO Use AMDBLAS: NO

NO Python 2: Interpreter: C:/Anaconda3_64bit/envs/python2k/python.exe (ver 2.7.13)

2.7.13) Python 3: Interpreter: C:/Anaconda3_64bit/envs/python3k/python.exe (ver 3.6.1)

3.6.1) Python (for build): C:/Anaconda3_64bit/envs/python2k/python.exe

C:/Anaconda3_64bit/envs/python2k/python.exe Java: ant: NO JNI: C:/Program Files/Java/jdk1.8.0_141/include C:/Program Files/Java/jdk1.8.0_141/include/win32 C:/Program Files/Java/jdk1.8.0_141/include Java wrappers: NO Java tests: NO

NO Matlab: NO

NO Documentation: Doxygen: NO

NO Tests and samples: Tests: YES Performance tests: YES C/C++ Examples: NO

NO Install path: C:/Users/USER/Development/3RD_PARTY/opencv-3.2.0_vc14_64

C:/Users/USER/Development/3RD_PARTY/opencv-3.2.0_vc14_64 cvconfig.h is in: C:/Users/USER/Development/3RD_PARTY/opencv-3.2/opencv-master/build

C:/Users/USER/Development/3RD_PARTY/opencv-3.2/opencv-master/build -----------------------------------------------------------------