trying to compile openNI example

hi there,

i’m working on oF 007, mac OSX 10.6.8, and i’ve been trying to compile the example “openNI-demoAllFeatures”, that comes with the ofxOpenNI addon, but i’m getting the following error on the GDP console:

dyld: Library not loaded: @executable_path/./../../../data/openni/lib/libusb-1.0.0.dylib  
  Referenced from: /Developer/Library/of_preRelease_v007_osx/apps/myapps/openNItest/bin/  
  Reason: no suitable image found.  Did find:  
	/usr/local/lib/libusb-1.0.0.dylib: mach-o, but wrong architecture  
sharedlibrary apply-load-rules all  
Data Formatters temporarily unavailable, will re-try after a 'continue'. (Cannot call into the loader at present, it is locked.)  

i don’t quite understand what’s happening. first of all, i can compile other examples (the basic example of the ofxOpenNI, for instance) that use that same library. googling around, i figured that it might be that the library i have installed in the system (in /usr/local/lib/) might not be properly configured, so i tried to recompile it following the instructions on openKinect (, but got same result.

does anyone have a clue?


try installing this version of libusb - it is usually an easy way to get going

hey jvcleave, thanks for your answer. i’ve tried to uninstall the libusb-devel library through macports and installing it again through this installer you have recommended, but no go. got the same error while trying to compile the example. any other suggestion? could gdb be accusing a “wrong” error or something like that?


if you go through macports make sure you add +universal (see

The problem is that the libusb you have installed in /usr/local is 64 bit and you need a 32bit version (or universal which is both 32/64bit) for OF/OpenNI

If you installed the PCL version you may have to add /opt/local/include to your Header Search Paths and /opt/local/lib to your library search path in the Project/Target settings

adding the paths to the Project/Target settings compiled the project successfully :slight_smile:

many thanks for your help!