ofxOpenNi linux

Hi all,

I’ve struggling with this for the last few days :

I try to use ofxOpenNi under linux (codeblocks) I’ve copied everythindg in the src directory got every search paths right but when I try to compile I get this error message on the file XnStatus.h (even when I point to the one installed on my system…) :

error : two or more data types in declaration of ‘parameter’

what I don’t get is that the app osceleton from sensebloom compiles just fine.

Could someone point me in the right direction please.

E

no one ?
I’m really stuck here , I don’t need full source code just a hint on how to compile an OF app wich would include OpenNI on Linux without those errors from xnstatus.h.

E

Ok I’ll answer my own question then :

I finally got ofx_not_Yet_An_addon to work with OF with linux.

I had to modify the xnstatus.h file that comes with openNI :

from line 54 :

where it says const XnStatus Status remove Status

XN_C_API const XnChar* xnGetStatusString(const XnStatus Status);

/**
* Gets the name of a Xiron Status as a string.
*
* @param Status [in] The input Xiron Status.
*
* @return A string representation of the Xiron status name.
*/
XN_C_API const XnChar* xnGetStatusName(const XnStatus Status);

/**
* Prints a user message with a description of the error.
*
* @param Status [in] The input Xiron Status.
* @param csUserMessage [in] A user message.
*
*/
XN_C_API void xnPrintError(const XnStatus Status, const XnChar* csUserMessage);

see the attach file for a screengrab hope that can be useful to someone.

E

hehe plusplusweb, we were struggling with the same thing at the same time.

I ended up renaming Status to something like __Status in the same place in the code as you did. It seems there is another Status already declared which is causing this problem.

I am not quite where you are yet, but getting there.

@plusplusweb

Can you share your codeblocks projet? Or maybe the steps you took?

I’m getting an error that says that codeblocks can’t find context.RunXmlScript, although I set the paths…

  
  
  
obj/Debug/addons/ofxOpenNI/src/ofxOpenNIContext.o     In function `xn::Context::RunXmlScript(char const*, xn::EnumerationErrors*)':  
  
)]+0x32)                             undefined reference to `xnContextRunXmlScript'  
  
=== Build finished: 1 errors, 0 warnings ===  
  

you should really not use variable names with one or two leading underscores.
http://stackoverflow.com/questions/2287-…-identifier
http://stackoverflow.com/questions/2243-…–much-in-c

I have same problem than dasankir

  
obj/Debug/addons/ofxOpenNI/src/ofxOpenNIContext.o||In function `xn::Context::RunXmlScript(char const*, xn::EnumerationErrors*)':|  
)]+0x32)||undefined reference to `xnContextRunXmlScript'|  
obj/Debug/addons/ofxOpenNI/src/ofxOpenNIRecorder.o||In function `xn::NodeWrapper::Release()':|  
ofxOpenNIRecorder.cpp:(.text._ZN2xn11NodeWrapper7ReleaseEv[xn::NodeWrapper::Release()]+0xf)||undefined reference to `xnProductionNodeRelease'|  
||=== Build finished: 2 errors, 0 warnings ===|  

Edit: With the latest unstable it works :wink:

[quote author=“mhersan”]I have same problem than dasankir

  
obj/Debug/addons/ofxOpenNI/src/ofxOpenNIContext.o||In function `xn::Context::RunXmlScript(char const*, xn::EnumerationErrors*)':|  
)]+0x32)||undefined reference to `xnContextRunXmlScript'|  
obj/Debug/addons/ofxOpenNI/src/ofxOpenNIRecorder.o||In function `xn::NodeWrapper::Release()':|  
ofxOpenNIRecorder.cpp:(.text._ZN2xn11NodeWrapper7ReleaseEv[xn::NodeWrapper::Release()]+0xf)||undefined reference to `xnProductionNodeRelease'|  
||=== Build finished: 2 errors, 0 warnings ===|  

Edit: With the latest unstable it works :wink:[/quote]

Solved too!

I think I dind’t install the proper: OpenNI + PrimeSense’s Sensor + NITE.

I explain my steps here: http://therandomlab.blogspot.com/2011/0-…–with.html

There is the of0062-codeblocks-project too.

hei i’m opening again this post i didn’t know it.

i’m moving here from http://forum.openframeworks.cc/t/running-ofxopenni-/6687/0

ok i’ve just reinstalled openni from original from www.openni.org
i’ve just redownloaded ofxopenni in this way: git clone https://github.com/gameoverhack/ofxOpenNI.git

i’m using only makefile, with no codeblocks
config.make seems to be broken in my of version, so i had to add USER_CFLAG directly in makefile for including of/addons/ofxOpenNI/include/openni

then i had to modify XnStatus.h following this steps: http://therandomlab.blogspot.com/2011/03/kinect-openni-niteskeleton-with.html

but now i have really a lot of undefined reference problem. in opencv, openni, poco, ofOpenALSoundPlayer, ofxUserGenerator

the last one for example is:

…/…/…/addons/ofxOpenCv/libs/opencv/lib/linux/libopencv_objdetect.a(haar.o): In function cvHaarDetectObjects': haar.cpp:(.text.cvHaarDetectObjects+0x1bf2): undefined reference tocvCanny’

tis is my g++ call:

g++ -o bin/ofxOpenNI obj/Release/src/testApp.o obj/Release/src/main.o obj/Release/addons/ofxOpenCv/src/ofxCvContourFinder.o obj/Release/addons/ofxOpenCv/src/ofxCvFloatImage.o obj/Release/addons/ofxOpenCv/src/ofxCvShortImage.o obj/Release/addons/ofxOpenCv/src/ofxCvHaarFinder.o obj/Release/addons/ofxOpenCv/src/ofxCvImage.o obj/Release/addons/ofxOpenCv/src/ofxCvGrayscaleImage.o obj/Release/addons/ofxOpenCv/src/ofxCvColorImage.o obj/Release/addons/ofxOpenNI/src/ofxOpenNIRecorder.o obj/Release/addons/ofxOpenNI/src/ofxHardwareDriver.o obj/Release/addons/ofxOpenNI/src/ofxHandGenerator.o obj/Release/addons/ofxOpenNI/src/ofxImageGenerator.o obj/Release/addons/ofxOpenNI/src/ofxDepthGenerator.o obj/Release/addons/ofxOpenNI/src/ofxGestureGenerator.o obj/Release/addons/ofxOpenNI/src/ofxTrackedUser.o obj/Release/addons/ofxOpenNI/src/ofxOpenNIContext.o obj/Release/addons/ofxOpenNI/src/ofxIRGenerator.o obj/Release/addons/ofxOpenNI/src/ofxTrackedHand.o obj/Release/addons/ofxOpenNI/src/ofxUserGenerator.o -L…/…/…/libs/fmodex/lib/linux -L…/…/…/libs/freetype/lib/linux -L…/…/…/libs/kiss/lib/linux -L…/…/…/libs/openFrameworksCompiled/lib/linux -L…/…/…/libs/poco/lib/linux -L…/…/…/libs/rtAudio/lib/linux -Wl,-rpath=./libs -lopenFrameworks -lfmodex -lfreetype -lkiss -lPocoFoundation -lPocoNet -lPocoUtil -lPocoXML -lRtAudio pkg-config gstreamer-0.10 gstreamer-video-0.10 gstreamer-base-0.10 libudev --libs -lglut -lGL -lGLU -lasound …/…/…/addons/ofxOpenCv/libs/opencv/lib/linux/libopencv_calib3d.a …/…/…/addons/ofxOpenCv/libs/opencv/lib/linux/libopencv_contrib.a …/…/…/addons/ofxOpenCv/libs/opencv/lib/linux/libopencv_core.a …/…/…/addons/ofxOpenCv/libs/opencv/lib/linux/libopencv_features2d.a …/…/…/addons/ofxOpenCv/libs/opencv/lib/linux/libopencv_flann.a …/…/…/addons/ofxOpenCv/libs/opencv/lib/linux/libopencv_gpu.a …/…/…/addons/ofxOpenCv/libs/opencv/lib/linux/libopencv_haartraining_engine.a …/…/…/addons/ofxOpenCv/libs/opencv/lib/linux/libopencv_highgui.a …/…/…/addons/ofxOpenCv/libs/opencv/lib/linux/libopencv_imgproc.a …/…/…/addons/ofxOpenCv/libs/opencv/lib/linux/libopencv_lapack.a …/…/…/addons/ofxOpenCv/libs/opencv/lib/linux/libopencv_legacy.a …/…/…/addons/ofxOpenCv/libs/opencv/lib/linux/libopencv_ml.a …/…/…/addons/ofxOpenCv/libs/opencv/lib/linux/libopencv_objdetect.a …/…/…/addons/ofxOpenCv/libs/opencv/lib/linux/libopencv_video.a …/…/…/addons/ofxOpenCv/libs/opencv/lib/linux/libzlib.a …/…/…/addons/ofxOsc/libs/oscpack/lib/linux/liboscpack.a

so… no ideas?

if i don’t use USER_CFLAG the compiler can’t find the files .h that ofxOpenNI need (openni, nite, libusb).
if i add the path in USER_CFLAG the compiler get a lot of undefined reference in mostly every libs of openframeworks (poco, sound, ofImage, opencv, and also openni and libusb)

what could it be?
i’m getting mad with this compilation error!

EDIT:
i’ve found (here: http://www.patriciogonzalezvivo.com/blog/?p=213 ) a real awesome example. it uses openNi and has a good file structure and a good makefile with good USER_CFLAGS, USER_LDFLAGS and USER_LIBS.

this thread was my homepage for a while

<3 y’all

This is really confusing.

I can build the OpenNIdemoallfeatures and this error doesn’t appear.

If I copy the demo folder and put in my empty source files, as soon as I declare
#include “ofxOpenNI.h”
I get the error.

Renaming Status to _Status in 3 places in XnStatus.h fixes it- seemingly- and I can still compile the original demo.

I don’t get it. Anyway not to worry.