I have downloaded the release lib of libfreenect2 from git (https://github.com/OpenKinect/libfreenect2/releases)
and added the lib to my project inproperties->linker->input->additional dependancies
and added the path to the lib inproperties->linker->general->additional library directories
I installed the nvidia gpu computing toolkit and added OpenCL.lib toproperties->linker->input->additional dependancies
and added the path to the lib inproperties->linker->general->additional library directories
and added the opencl (and cuda) include folder toproperties->C/C++->General->additional include directories
The example compiles but I get linker errors I don’t understand (only 2).
Error unresolved external symbol "public: __cdecl libfreenect2::OpenCLKdePacketPipeline::OpenCLKdePacketPipeline(int)" (??0OpenCLKdePacketPipeline@libfreenect2@@QEAA@H@Z) example C:\Users\Fred\Documents\openFrameworks\addons\ofxKinectV2\example C:\Users\Fred\Documents\openFrameworks\addons\ofxKinectV2\example\ofProtonect.obj 1
and
Error unresolved external symbol "public: __cdecl libfreenect2::OpenCLPacketPipeline::OpenCLPacketPipeline(int)" (??0OpenCLPacketPipeline@libfreenect2@@QEAA@H@Z) example C:\Users\Fred\Documents\openFrameworks\addons\ofxKinectV2\example C:\Users\Fred\Documents\openFrameworks\addons\ofxKinectV2\example\ofProtonect.obj 1
Ideally I would like to use CUDA instead of openCL for its performance advantage, but openCL would be fine if I can get it to compile.
I have a further question related to CUDA. I see in the config.h file a lot of defines that switch the image decoding and hardware acceleration methods. I don’t really get the structure or how I should change them. I thought I should just use a pre-processor definition in the project properties but this gives redefinition warnings and I am not sure if this is how it should work.
For example, I have added the cuda.lib and include paths and added a pre-processor definition inproperties->C/C++->Preprocessor->preprocessor definitions LIBFREENECT2_WITH_CUDA_SUPPORT
and inproperties->C/C++->Preprocessor->undefine preprocessor definitions LIBFREENECT2_WITH_OPENCL_SUPPORT;LIBFREENECT2_WITH_OPENGL_SUPPORT
When I do this it seems correct but then I get the following errors:
'CUDAKDEPacketPipeline': is not a member of 'libfreenect2'
'CUDAPacketPipeline': is not a member of 'libfreenect2'
syntax error: identifier 'CUDAKDEPacketPipeline'
syntax error: identifier 'CUDAPacketPipeline'
So to summarize:
Is using pre=processor macros on VS2017 the right way to switch from opencl to Cuda?
Can I use the lib from the releases download to work with Cuda?
Can I use the lib from the releases download in VS2017, with or without setting the project to build for VS2015 v140?
Any clues on how I can solve these errors?
Sorry for the long post, I am not an experienced programmer but would like to switch to libfreenect2 from the KinectV2 SDK to allow for multiple kinects. I tried to outline my situation as clearly as possible but can add any details if it can help.
Cheers
Fred