Closed SWAGamaz closed 9 months ago
Hello, I am also having the same issue building OpenCV for ARM64, it fails with this error: 15>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\emmintrin.h(20,1): fatal error C1189: #error: This header is specific to X86 and X64 targets.
Using CMake 3.16.3, Visual Studio 2019, and OpenCV 4.3.0, please let me know if you have any insight into this error or if you have a successful build you can provide, thanks!
Hi, sorry to hear you have troubles with compiling OpenCV for ARM64. I have uploaded my build here, I hope that works. Don't forget that you still need to configure the additional include directories and dependencies in the solution.
Otherwise, here are few things that might help when compiling OpenCV for ARM64 from source (these are from my notes, it has been a while since I've done this). Tested with CMake 3.18.4 GUI, OpenCV 4.3.0 and Visual Studio 2017.
Windows RT support: YES
Hi Christina,
Thank you for the response, I was able to build openCV 4.3.0 for ARM64 successfully with VS 2019 using your instructions, I just had to also disable the BUILD_opencv_rgbd and BUILD_opencv_tracking options. The HL2ToolTrackingWRC solution built fine as well, if you have a sample unity application you could provide that demos how to use the plugin that would be much appreciated. Thanks for the great work!
@cgsaxner , many thanks for the instructions. The library has been successfully compiled. Now I'm having trouble using it in Unity. Could you share a code example on how to include and use HL2ToolTrackingWRC.dll in a Unity project?
I added .dll and .winmd files to the project and tried to call the wrapped library:
#if ENABLE_WINMD_SUPPORT
using HL2ToolTrackingWRC;
HL2ToolTracking tracking = new HL2ToolTracking();
#endif
but I get an error:
error CS0009: Metadata file 'D:\Unity\Proj\ToolTracker\Assets\Plugins\HL2ToolTrackingWRC\HL2ToolTrackingWRC.dll' could not be opened -- PE image doesn't contain managed metadata.
But I can’t imagine how to add a constructor to make an instance of an object using DllImport.
Hi!
@SWAGamaz code should work. Have you made sure that the plugins (.winmd and .dll files) are configured in the Unity Inspector to use WSA Player and ARM64 platform:
If you put your plugins in a folder Assets\Plugins\WSA\ARM\...
, Unity should automatically configure them correctly.
Also, make sure that you include the dlls for OpenCV dependencies in the same folder / configure them in the same way (i.e., opencv_calib3d, opencv_core, opencv_features2d, opencv_flann, opencv_imgproc, opencv_video).
I will try to upload a Unity sample project soon.
Good day. I'm having trouble compiling the OpenCV library for the UWP/ARM64 platform with CMake. When compiling for the ARM / ARM 64 platform, there are countless errors. Could you please share the finished OpenCV >= 4.3.0 library for UWP / ARM64 ?