roymacdonald / ofxOpenNI

this used to be a fork from https://github.com/gameoverhack/ofxOpenNI/
14 stars 5 forks source link

libusb.h #3

Open gazpachu opened 10 years ago

gazpachu commented 10 years ago

I know this repo is quite old, but I have a few demos with this plugin and I've been having a hard time to make them work again with other ofxopenni and ofxopenni2.

I'm having issues with libusb.h in windows with codeblocks. I don't know it keeps complaining about that file.

Any help would be much appreciated.

Thanks

roymacdonald commented 10 years ago

HI, I've never used it in windows. What issues are you getting?

gazpachu commented 10 years ago

I'm using nite-win32-1.5.2.21-dev, openni-win32-1.5.4.0-dev, Codeblocks 10.05 and OF 0.7.1 in Windows 8 with the Kinect SDK 1.8 drivers (although my original setup was win7).

If I don't include the path to libusb (which I believe is what I was doing 2 years ago), then it complains in "/ofxOpenNi/src/ofxHardwareDriver.h", line 6:

// based on ROS kinect_aux.cpp driver and freenect tilt.c for controlling motor and accelerometers 
#include "ofMain.h"
#include <libusb.h>

If I include "/ofxOpenNi/include/libusb" as a search path in the project, it complains in line 500 of "libusb.h"

/** Array of interfaces supported by this configuration. The length of
 * this array is determined by the bNumInterfaces field. */
const struct libusb_interface *interface;

I'm not sure if I have to install "libusb" on windows, maybe I did but I can't remember how to do it.

The truth is Windows is a f****\ nightmare for OF stuff. I'm even considering buying a macbook

roymacdonald commented 9 years ago

Hi, I've never used such configuration, so I have no idea, yet what seems to be a bit weird is using the Kinect SDK drivers. I would say that there´s the problem. try installing the drivers that were intended to be used with openni. Best!

gazpachu commented 9 years ago

I gave up and bought a macbook. Now I'm stucked in here ;-(

ld: warning: directory not found for option '-L/Users/gazpachu/Work/OF/v0.8.4/apps/myApps/magic_dust/bindata/openni/lib' ld: library not found for -lOpenNI clang: error: linker command failed with exit code 1 (use -v to see invocation)

roymacdonald commented 9 years ago

Hi, did you copy the openni libs into that directory in your project's data folder? That seems to be the problem. best

gazpachu commented 9 years ago

Yes, the files are there, but I'm not sure why is picking the path up as 'bindata' rather than 'bin/data'.

This is the extended log:

Ld bin/magic_dustDebug.app/Contents/MacOS/magic_dustDebug normal i386 cd /Users/gazpachu/Work/OF/v0.8.4/apps/myApps/magic_dust /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -L/Users/gazpachu/Work/OF/v0.8.4/apps/myApps/magic_dust/bin -L/Users/gazpachu/Work/OF/v0.8.4/apps/myApps/magic_dust/bindata/openni/lib -F/Users/gazpachu/Work/OF/v0.8.4/apps/myApps/magic_dust/bin -F/Users/gazpachu/Work/OF/v0.8.4/apps/myApps/magic_dust/../../../libs/glut/lib/osx -filelist /Users/gazpachu/Library/Developer/Xcode/DerivedData/magic_dust-bgfvlszxmbtqdhgjwnagqbnuxcou/Build/Intermediates/magic_dust.build/Debug/magic_dust.build/Objects-normal/i386/magic_dustDebug.LinkFileList -dead_strip ../../../libs/poco/lib/osx/PocoCrypto.a ../../../libs/poco/lib/osx/PocoData.a ../../../libs/poco/lib/osx/PocoDataODBC.a ../../../libs/poco/lib/osx/PocoDataSQLite.a ../../../libs/poco/lib/osx/PocoFoundation.a ../../../libs/poco/lib/osx/PocoNet.a ../../../libs/poco/lib/osx/PocoNetSSL.a ../../../libs/poco/lib/osx/PocoUtil.a ../../../libs/poco/lib/osx/PocoXML.a ../../../libs/poco/lib/osx/PocoZip.a ../../../libs/tess2/lib/osx/tess2.a ../../../libs/glew/lib/osx/glew.a ../../../libs/cairo/lib/osx/cairo-script-interpreter.a ../../../libs/cairo/lib/osx/cairo.a ../../../libs/cairo/lib/osx/pixman-1.a ../../../libs/fmodex/lib/osx/libfmodex.dylib ../../../libs/rtAudio/lib/osx/rtAudio.a ../../../libs/openssl/lib/osx/crypto.a ../../../libs/openssl/lib/osx/ssl.a ../../../libs/glfw/lib/osx/libglfw3.a ../../../libs/FreeImage/lib/osx/freeimage.a ../../../libs/freetype/lib/osx/freetype.a -stdlib=libstdc++ -framework Accelerate -framework QTKit -framework GLUT /Users/gazpachu/Work/OF/v0.8.4/libs/openFrameworksCompiled/lib/osx/openFrameworksDebug.a -framework AGL -framework ApplicationServices -framework AudioToolbox -framework CoreAudio -framework CoreFoundation -framework CoreServices -framework OpenGL -framework QuickTime -framework AppKit -lOpenNI -framework Cocoa -framework IOKit -framework CoreVideo -Xlinker -dependency_info -Xlinker /Users/gazpachu/Library/Developer/Xcode/DerivedData/magic_dust-bgfvlszxmbtqdhgjwnagqbnuxcou/Build/Intermediates/magic_dust.build/Debug/magic_dust.build/Objects-normal/i386/magic_dustDebug_dependency_info.dat -o /Users/gazpachu/Work/OF/v0.8.4/apps/myApps/magic_dust/bin/magic_dustDebug.app/Contents/MacOS/magic_dustDebug

ld: warning: directory not found for option '-L/Users/gazpachu/Work/OF/v0.8.4/apps/myApps/magic_dust/bindata/openni/lib' ld: library not found for -lOpenNI clang: error: linker command failed with exit code 1 (use -v to see invocation)

roymacdonald commented 9 years ago

check the linker options to add that missing slash. I guess that you're using xcode. clic on the project item in the project navigator pane. it should be the pane at the left, the item should be the topmost one in this pane, make sure that the folder icon is selected on the top of this pane, otherwise you wont see the project item. This will reveal the project settings. There select the build settings tab and find the other linker flags. There you will find the library search paths and you'll be able to correct it. when you double clic it to edit it, probably it will show the paths definitions rather that the paths it self. Just scroll down, these definitions are at the end. Hope this helps. best

fiebrink1 commented 7 years ago

Following on @roymacdonald 's advice, I specifically fixed this by choosing the Target to edit, then editing in Search Paths -> Library Search Paths -> Release -> edit the very last row so it's "$(BUILT_PRODUCTS_DIR)/data/openni/lib"