inconsistent outcomes when linking in libuvc.dylib
Closed this issue · 4 comments
would anybody be so kind to show me what elements are needed to get this to work reliably ... in eclipse i specify the libuvc4j.jar with library location for libuvc.dylib in usr/local. i made this into a user library as well and include this in my projects. in some projects this works just fine, but in some cases i see this at the start of runtime
Feb 28, 2016 12:22:37 PM org.bridj.BridJ log INFO: Failed to get address of method protected static native void org.openpnp.libuvc4j.UvcLibrary.uvc_set_button_callback(long,org.openpnp.libuvc4j.UvcLibrary$uvc_button_callback_t,long) Feb 28, 2016 12:22:37 PM org.bridj.BridJ log INFO: Failed to get address of method protected static native int org.openpnp.libuvc4j.UvcLibrary.uvc_yuyv2y(long,long) Feb 28, 2016 12:22:37 PM org.bridj.BridJ log INFO: Failed to get address of method protected static native int org.openpnp.libuvc4j.UvcLibrary.uvc_yuyv2uv(long,long) Feb 28, 2016 12:22:37 PM org.bridj.BridJ log INFO: Failed to get address of method protected static native int org.openpnp.libuvc4j.UvcLibrary.uvc_mjpeg2rgb(long,long)
and later when i use one of these routines ...
Exception in thread "Thread-2" java.lang.UnsatisfiedLinkError: org.openpnp.libuvc4j.UvcLibrary.uvc_mjpeg2rgb(JJ)I at org.openpnp.libuvc4j.UvcLibrary.uvc_mjpeg2rgb(Native Method) at org.openpnp.libuvc4j.UvcLibrary.uvc_mjpeg2rgb(UvcLibrary.java:1537) at com.lobsterman.JavaGrinders.control.UVCDeviceManager_pnp$1.apply(UVCDeviceManager_pnp.java:494)
so it does not find implementations for these in the dylib. i believe i am doing the very same thing in the instances that work and those that don't. any suggestions where the critical elements reside that make this work? also what is special about these libuvc calls? why only those, while all others work fine? any suggestions?
Hi Robert,
I suspect that what is happening is sometimes your application is finding a
difference libuvc than the one you are specifying. I'd check your library
paths. You may have one installed that was not compiled with JPEG support,
which would be the cause for at least some of those errors.
Jason
On Sun, Feb 28, 2016 at 1:53 PM Robert Huber notifications@github.com
wrote:
would anybody be so kind to show me what elements are needed to get this
to work reliably ... in eclipse i specify the libuvc4j.jar with library
location for libuvc.dylib in usr/local. i made this into a user library as
well and include this in my projects. in some projects this works just
fine, but in some cases i see this at the start of runtimeFeb 28, 2016 12:22:37 PM org.bridj.BridJ log INFO: Failed to get address
of method protected static native void
org.openpnp.libuvc4j.UvcLibrary.uvc_set_button_callback(long,org.openpnp.libuvc4j.UvcLibrary$uvc_button_callback_t,long)
Feb 28, 2016 12:22:37 PM org.bridj.BridJ log INFO: Failed to get address of
method protected static native int
org.openpnp.libuvc4j.UvcLibrary.uvc_yuyv2y(long,long) Feb 28, 2016 12:22:37
PM org.bridj.BridJ log INFO: Failed to get address of method protected
static native int org.openpnp.libuvc4j.UvcLibrary.uvc_yuyv2uv(long,long)
Feb 28, 2016 12:22:37 PM org.bridj.BridJ log INFO: Failed to get address of
method protected static native int
org.openpnp.libuvc4j.UvcLibrary.uvc_mjpeg2rgb(long,long)and later when i use one of these routines ...
Exception in thread "Thread-2" java.lang.UnsatisfiedLinkError:
org.openpnp.libuvc4j.UvcLibrary.uvc_mjpeg2rgb(JJ)I at
org.openpnp.libuvc4j.UvcLibrary.uvc_mjpeg2rgb(Native Method) at
org.openpnp.libuvc4j.UvcLibrary.uvc_mjpeg2rgb(UvcLibrary.java:1537) at
com.lobsterman.JavaGrinders.control.UVCDeviceManager_pnp$1.apply(UVCDeviceManager_pnp.java:494)so it does not find implementations for these in the dylib. i believe i am
doing the very same thing in the instances that work and those that don't.
any suggestions where the critical elements reside that make this work?
also what is special about these libuvc calls? why only those, while all
others work fine? any suggestions?—
Reply to this email directly or view it on GitHub
#5.
i just recompiled libuvc, made sure jpeg was enabled. cmake installs in usr/local/ so i made sure i copied the dylib and the headers into their respective places in opt/local. in eclipse i made sure that my native library location for my libuvc4j userlibrary point to opt/local/lib and I set the environmental variable DYLD_LIBRARY_PATH to opt/local/lib. as far as i can tell, every possible place within my project is looking at opt/local/ for the library, and the library is the one i just made which had reported that jpeg support was enabled. outcome still is the same as before
Feb 29, 2016 10:00:30 AM org.bridj.BridJ log INFO: Failed to get address of method protected static native int org.openpnp.libuvc4j.UvcLibrary.uvc_mjpeg2rgb(long,long) Feb 29, 2016 10:00:30 AM org.bridj.BridJ log INFO: Failed to get address of method protected static native void org.openpnp.libuvc4j.UvcLibrary.uvc_set_button_callback(long,org.openpnp.libuvc4j.UvcLibrary$uvc_button_callback_t,long) Feb 29, 2016 10:00:30 AM org.bridj.BridJ log INFO: Failed to get address of method protected static native int org.openpnp.libuvc4j.UvcLibrary.uvc_yuyv2y(long,long) Feb 29, 2016 10:00:30 AM org.bridj.BridJ log INFO: Failed to get address of method protected static native int org.openpnp.libuvc4j.UvcLibrary.uvc_yuyv2uv(long,long)
the only thing i can imagine is that Bridj is looking for the lib at some other place, does that make sense? i don't see where i can control separately how bridj does its thing. yesterday i had opened this as an issue on the JNAerator list as well, but not sure how active that list is.
Sorry Robert, I don't have a good answer for you here. If you figure it out
please do report back.
Jason
On Mon, Feb 29, 2016 at 7:06 AM Robert Huber notifications@github.com
wrote:
i just recompiled libuvc, made sure jpeg was enabled. cmake installs in
usr/local/ so i made sure i copied the dylib and the headers into their
respective places in opt/local. in eclipse i made sure that my native
library location for my libuvc4j userlibrary point to opt/local/lib and I
set the environmental variable DYLD_LIBRARY_PATH to opt/local/lib. as far
as i can tell, every possible place within my project is looking at
opt/local/ for the library, and the library is the one i just made which
had reported that jpeg support was enabled. outcome still is the same as
beforeFeb 29, 2016 10:00:30 AM org.bridj.BridJ log
INFO: Failed to get address of method protected static native int
org.openpnp.libuvc4j.UvcLibrary.uvc_mjpeg2rgb(long,long)
Feb 29, 2016 10:00:30 AM org.bridj.BridJ log
INFO: Failed to get address of method protected static native void
org.openpnp.libuvc4j.UvcLibrary.uvc_set_button_callback(long,org.openpnp.libuvc4j.UvcLibrary$uvc_button_callback_t,long)
Feb 29, 2016 10:00:30 AM org.bridj.BridJ log
INFO: Failed to get address of method protected static native int
org.openpnp.libuvc4j.UvcLibrary.uvc_yuyv2y(long,long)
Feb 29, 2016 10:00:30 AM org.bridj.BridJ log
INFO: Failed to get address of method protected static native int
org.openpnp.libuvc4j.UvcLibrary.uvc_yuyv2uv(long,long)the only thing i can imagine is that Bridj is looking for the lib at some
other place, does that make sense? i don't see where i can control
separately how bridj does its thing. yesterday i had opened this as an
issue on the bridj list as well, but not sure how active that list is.—
Reply to this email directly or view it on GitHub
#5 (comment).
Thanks jason. The fact that the main project failed, while the simpler ones worked, was useful. i started with the simple working one and kept adding complexity from the second non-working one to find out at what step the thing would break. turns out ... it never did. I then deleted the non-working project from my eclipse workspace and i had the import wizard redo the project from scratch - still no go. so i deleted it and went with the new project instead, renamed to old name ... life is good now. It strikes me that this is a nasty bug on library paths somewhere in the bowels of eclipse that gets attached to a folder? in any case, i deleted the broken project folder and went with the new unbroken on. back in business. closing the issue as not related to libuvc4j