I recently tried to get my Kinect v1 to work again on Windows 8 with gcc and I thought it would be nice to document the process to save others some time.
I had to add four lines in "C:\Program Files\OpenNI2\Include\OniPlatform.h":
#ifdef __MINGW32__
#include "Win32/OniPlatformWin32.h"
#else
#if (defined _WIN32)
# ifndef RC_INVOKED
# if _MSC_VER < 1300
# error OpenNI Platform Abstraction Layer - Win32 - Microsoft Visual Studio version below 2003 (7.0) are not supported!
# endif
# endif
#elif defined (ANDROID) && defined (__arm__)
# include "Android-Arm/OniPlatformAndroid-Arm.h"
#elif (__linux__ && (i386 || __x86_64__))
# include "Linux-x86/OniPlatformLinux-x86.h"
#elif (__linux__ && __arm__)
# include "Linux-Arm/OniPlatformLinux-Arm.h"
#elif _ARC
# include "ARC/OniPlaformARC.h"
#elif (__APPLE__)
# include "MacOSX/OniPlatformMacOSX.h"
#else
# error Xiron Platform Abstraction Layer - Unsupported Platform!
#endif
#endif
To compile a sample, I had to link against the dlls directly because gcc can not handle the libs. Note that gcc will link against the incompatible .libs instead of .dlls if they are in the same directory and things will not compile. I copied the SimpleViewer sample directory to my desktop for permission reasons and deleted all *.lib files in it. I also copied the OpenNI2 directory from "C:\Program Files\OpenNI2\Redist" and OpenNI2.dll into it. It looks like this:
If the KinectSDK is not installed, there will be a "no device found" error, which is obvious if it is known that this library works on top of it, but I did not know that at this point.
My USB 2.0 port seems to be incompatible with the Kinect v1, but my USB 3.0 port works fine. The error message of NiViewer.exe was "Depth stream is off" and "Color stream is off" and then it crashed horribly.
I recently tried to get my Kinect v1 to work again on Windows 8 with gcc and I thought it would be nice to document the process to save others some time.
I have installed:
I had to add four lines in "C:\Program Files\OpenNI2\Include\OniPlatform.h":
To compile a sample, I had to link against the dlls directly because gcc can not handle the libs. Note that gcc will link against the incompatible .libs instead of .dlls if they are in the same directory and things will not compile. I copied the SimpleViewer sample directory to my desktop for permission reasons and deleted all *.lib files in it. I also copied the OpenNI2 directory from "C:\Program Files\OpenNI2\Redist" and OpenNI2.dll into it. It looks like this:
My compiler invocation in compile.bat is:
Other gotchas: