OpenCV UWP build fails.

asked 2017-11-24 18:19:34 -0500


I cloned the official github repo of OpenCV and used CMake to build the VS Solution.

 cmake -G "Visual Studio 14 2015" -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0" .

As you can see, I want to build OpenCV for UWP 32-Bit. When building in VS 2015 the opencv_core module fails with:

Error   C2664   'BOOL CreateDirectoryA(LPCSTR,LPSECURITY_ATTRIBUTES)': cannot convert argument 1 from 'wchar_t [260]' to 'LPCSTR'
Error   C2039   'CreateFileA': is not a member of '`global namespace''  
Error   C3861   'CreateFileA': identifier not found
Error   C2664   'DWORD GetTempPathW(DWORD,LPWSTR)': cannot convert argument 2 from 'char [261]' to 'LPWSTR'

All these error are in the opencv_core in the file "filesystem.cpp. Now, I already successfully build it a few weeks ago, before I had to reformat my pc. Now it just won't build and I don't know exactly how to fix these errors. I would prefer to not modify the opencv source code.

edit retag flag offensive close merge delete


i'm not using UWP, but it looks like there's some conflict between ascii string handling (what opencv does) and UNICODE (what your build type expects)

berak gravatar imageberak ( 2017-11-25 05:09:33 -0500 )edit