How to use ofxKinectNui on CodeBlocks

Hi

ofxKinectNui worked without problems on Visual Studio, but I like CodeBlocks. This is the steps I followed on CodeBlocks:

  • Copy the emptyExample.workspace and emptyExample.cbp to addons\ofxKinectNui\exampleple to addons\ofxKinectNui\example
  • On CodeBlocks, right clic on emptyExample, go to Build Options, select emptyExample on the left, select Linker Settings tab and the Add button.
  • Go to C:\Program Files\Microsoft SDKs\Kinect\v1.0\lib\x86\ and select Kinect10.lib
  • Go to Search Directories and add this paths
    …\src
    …\src\kinect\nui
    …\src\win32
    C:\Program Files\Microsoft SDKs\Kinect\v1.0\inc

After compile I get the following errors:

||=== emptyExample, release ===|
C:\Program Files\Microsoft SDKs\Kinect\v1.0\inc\NuiSensor.h|244|warning: extra tokens at end of #endif directive|
C:\Program Files\Microsoft SDKs\Kinect\v1.0\inc\NuiImageCamera.h|118|warning: extra tokens at end of #endif directive|
C:\Program Files\Microsoft SDKs\Kinect\v1.0\inc\NuiImageCamera.h|151|warning: extra tokens at end of #endif directive|
c:\program files\codeblocks\mingw\bin…\lib\gcc\mingw32\4.4.1\include\c++\c++0x_warning.h|31|error: #error This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options.|
…\src\kinect\nui\AudioStream.h|20|error: wmcodecdsp.h: No such file or directory|
…\src\kinect\nui\AudioStream.h|22|error: mfapi.h: No such file or directory|
C:\Program Files\Microsoft SDKs\Kinect\v1.0\inc\NuiApi.h|36|warning: ‘__stdcall__’ attribute only applies to function types|
C:\Program Files\Microsoft SDKs\Kinect\v1.0\inc\NuiApi.h|36|error: definition of ‘HRESULT NuiInitialize’ is marked ‘dllimport’|
C:\Program Files\Microsoft SDKs\Kinect\v1.0\inc\NuiApi.h|36|error: ‘_In_’ was not declared in this scope|
C:\Program Files\Microsoft SDKs\Kinect\v1.0\inc\NuiApi.h|64|error: expected constructor, destructor, or type conversion before ‘(’ token|
C:\Program Files\Microsoft SDKs\Kinect\v1.0\inc\NuiSensor.h|867|error: ‘_Check_return_’ does not name a type|
C:\Program Files\Microsoft SDKs\Kinect\v1.0\inc\NuiSensor.h|868|error: ‘_Check_return_’ does not name a type|
C:\Program Files\Microsoft SDKs\Kinect\v1.0\inc\NuiSensor.h|869|error: ‘_Check_return_’ does not name a type|
C:\Program Files\Microsoft SDKs\Kinect\v1.0\inc\NuiSensor.h|870|error: ‘_Check_return_’ does not name a type|
C:\Program Files\Microsoft SDKs\Kinect\v1.0\inc\NuiSensor.h|875|error: expected constructor, destructor, or type conversion before ‘inline’|
C:\Program Files\Microsoft SDKs\Kinect\v1.0\inc\NuiSensor.h|895|error: ‘_Check_return_’ does not name a type|
C:\Program Files\Microsoft SDKs\Kinect\v1.0\inc\NuiSensor.h|910|error: ‘_Check_return_’ does not name a type|
C:\Program Files\Microsoft SDKs\Kinect\v1.0\inc\NuiImageCamera.h|39|error: variable or field ‘NuiImageResolutionToSize’ declared void|
C:\Program Files\Microsoft SDKs\Kinect\v1.0\inc\NuiImageCamera.h|39|error: ‘_In_’ was not declared in this scope|
C:\Program Files\Microsoft SDKs\Kinect\v1.0\inc\NuiImageCamera.h|39|error: ‘_Out_’ was not declared in this scope|
C:\Program Files\Microsoft SDKs\Kinect\v1.0\inc\NuiImageCamera.h|39|error: ‘_Out_’ was not declared in this scope|
c:\program files\codeblocks\mingw\bin…\lib\gcc\mingw32\4.4.1…\include\poppack.h|2|error: expected ‘}’ before end of line|
c:\program files\codeblocks\mingw\bin…\lib\gcc\mingw32\4.4.1…\include\poppack.h|2|error: expected declaration before end of line|
||=== Build finished: 19 errors, 4 warnings ===|

I tried -std=c++0x and -std=gnu++0x compiler options has sugested on one of the error messages, but no luck.

What can be wrong?
Thanks

@camilosw

Thx so much for your trial.
Yeah, I hope to add Code::Blocks project. : )

Hi camilosw,

Did you mange to compile this project in C::B?

Thanks

I don’t think you’re going to be able to get this working with a lot of messing around. The MS Kinect SDK is made to work with the MS compilers that are shipped with Visual Studio and there’s a lot of code that’s very specific to that compiler. CodeBlocks uses GCC, and there seems to be a lot of stuff that they’ve included in the project that doesn’t seem to work very well with GCC.

Thanks Joshua,

Its a shame as Ive been using C::B for the last few years and really liked it. Simonhr did have ofxMSKinect running with the beta SDK but its not been updated in over a year. I’ve moved over to VS2010 now