gameoverhack / ofxOpenNI

Wrapper for OpenNI, NITE and SensorKinect
gingold.com.au
Other
246 stars 121 forks source link

libusb bad link #18

Closed tucano closed 11 years ago

tucano commented 11 years ago

In the current version:

dyld: Library not loaded: /opt/local/lib/libusb-1.0.0.dylib Referenced from: /Users/drambald/Code/of_0071_osx_release/Code/kinactor_project/OniActor/bin/OniActorDebug.app/Contents/MacOS/./../../../data/openni/lib/libOpenNI.dylib Reason: image not found

you have linked the libusb from /opt/local/lib

running otool:

otool -L libOpenNI.dylib libOpenNI.dylib: @executable_path/./../../../data/openni/lib/libOpenNI.dylib (compatibility version 0.0.0, current version 0.0.0) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 550.44.0) /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0) /opt/local/lib/libusb-1.0.0.dylib (compatibility version 2.0.0, current version 2.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11) /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)

Can you link the version in data/openni please?

tucano commented 11 years ago

Quick FIX:

nstall_name_tool -change "/opt/local/lib/libusb-1.0.0.dylib" "@executable_path/./../../../data/openni/lib/libusb-1.0.0.dylib" libOpenNI.dylib

otool -L libOpenNI.dylib
libOpenNI.dylib: @executable_path/./../../../data/openni/lib/libOpenNI.dylib (compatibility version 0.0.0, current version 0.0.0) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 550.44.0) /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0) @executable_path/./../../../data/openni/lib/libusb-1.0.0.dylib (compatibility version 2.0.0, current version 2.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11) /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)

jasonmcdermott commented 11 years ago

@tucano would you mind explaining how to perform this quick fix? Can it be done via the terminal?

tucano commented 11 years ago

Sure!

Open the Terminal.App

go in the directory of ofxOpenNI where are located the libraries, your OF data dir:

PathToOF/APP/data/openni/lib/

Here you can use:

otool -L libOpenNI.dylib

to list dependencies of the ibrary

And install name tool to change paths:

install_name_tool -change "/opt/local/lib/libusb-1.0.0.dylib" "@executable_path/./../../../data/openni/lib/libusb-1.0.0.dylib" libOpenNI.dylib