trouble using libfreenect in another project.

343 views
Skip to first unread message

Frederick Rodrigues

unread,
Dec 16, 2018, 7:23:52 PM12/16/18
to OpenKinect
Hi, I want to use libfreenect2 with an existing VS2017 project ( specifically with openframeworks). I have made some progress but get stuck on a few things that I think are generic issues. It would be great if someone could help me. I am using VS2017 and  the release download of the lib and have included the lib and the headers. I have set my project to be VS2015 v140.

I have installed cuda (nvidia gpu computing toolkit with examples) and added the lib and the include files to my project. The errors I get seem simple but I am not sure how to solve them. I will outline my process:

I have downloaded the release lib of libfreenect2 from git (https://github.com/OpenKinect/libfreenect2/releases)
and added the lib to my project in
properties->linker->input->additional dependancies
and added the path to the lib in
properties->linker->general->additional library directories

I installed the nvidia gpu computing toolkit and added OpenCL.lib to
properties->linker->input->additional dependancies
and added the path to the lib in
properties->linker->general->additional library directories
and added the opencl (and cuda) include folder to
properties->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 in
properties->C/C++->Preprocessor->preprocessor definitions LIBFREENECT2_WITH_CUDA_SUPPORT

and in
properties->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

Reply all
Reply to author
Forward
0 new messages