GPhoto/SimpleCam DeviceAdapter

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

GPhoto/SimpleCam DeviceAdapter

Stefan Schoenleitner
Hi,

I would like to use my Canon EOS Camera with micro-manager.
I successfully compiled the SimpleCam DeviceAdapter, but when trying to load it, I get the following error:


LOG(2011-11-12T21:24:06.881532, 31866, 140082289166080:): Error occured. Device core. /usr/local/lib/micro-manager/libmmgr_dal_GPhoto.so.0: undefined symbol: _ZN8fipImage14flipHorizontalEv GPhoto


Since both the compile and linking process succeeded without errors, I'm not really sure why loading the library fails.
I'm using libgphoto2 2.4.11.

Did anyone else experience this ?

regards,
Stefan

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: GPhoto/SimpleCam DeviceAdapter

Stefan Schoenleitner
Hi,

On 11/12/2011 09:50 PM, Stefan Schoenleitner wrote:
> LOG(2011-11-12T21:24:06.881532, 31866, 140082289166080:): Error occured. Device core. /usr/local/lib/micro-manager/libmmgr_dal_GPhoto.so.0: undefined symbol: _ZN8fipImage14flipHorizontalEv GPhoto
>
>
> Since both the compile and linking process succeeded without errors, I'm not really sure why loading the library fails.
> I'm using libgphoto2 2.4.11.

the problem was that the library was not properly linked with FreeImage
and FreeImagePlus.

By adding the linker archives to SimpleCam/Makefile.am, I was able to
link it properly and get rid of the error:

# FreeImage library
# libmmgr_dal_GPhoto_la_LIBADD += /usr/local/lib/libfreeimage.la
libmmgr_dal_GPhoto_la_LIBADD += /usr/local/lib/libfreeimage.a
libmmgr_dal_GPhoto_la_LIBADD += /usr/local/lib/libfreeimageplus.a
libmmgr_dal_GPhoto_la_LIBADD += $(LIBFREEIMAGE)

cheers,
stefan

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: GPhoto/SimpleCam DeviceAdapter

Johannes Schindelin
Hi,

On Sun, 13 Nov 2011, Stefan Schoenleitner wrote:

> On 11/12/2011 09:50 PM, Stefan Schoenleitner wrote:
> > LOG(2011-11-12T21:24:06.881532, 31866, 140082289166080:): Error
> > occured. Device core.
> > /usr/local/lib/micro-manager/libmmgr_dal_GPhoto.so.0: undefined
> > symbol: _ZN8fipImage14flipHorizontalEv GPhoto
> >
> >
> > Since both the compile and linking process succeeded without errors,
> > I'm not really sure why loading the library fails. I'm using
> > libgphoto2 2.4.11.
>
> the problem was that the library was not properly linked with FreeImage
> and FreeImagePlus.

I wonder whether there is a better solution than to link to static
libraries. Since all of this is in /usr/local/, is it possible that GPhoto
has a wrong rpath? Or that /usr/local/lib/ is not properly indexed by
ld_config after installing GPhoto. It is really curious that the link
stage works but the runtime linking fails.

Ciao,
Johannes

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: GPhoto/SimpleCam DeviceAdapter

Stefan Schoenleitner
Hi,

On 11/13/2011 04:08 PM, Johannes Schindelin wrote:
> I wonder whether there is a better solution than to link to static
> libraries. Since all of this is in /usr/local/, is it possible that GPhoto
> has a wrong rpath? Or that /usr/local/lib/ is not properly indexed by
> ld_config after installing GPhoto.

Both libfreeimage and libfreeimageplus are in /usr/local/lib.
On the system, this is the only place where these libraries are installed and ld.so is configured to search in /usr/local/lib.
I also ran ldconfig to ensure that the the linker cache is up to date.
Still, when compiling it without statically linking to the FreeImage libraries, I get undefined symbols.

> It is really curious that the link
> stage works but the runtime linking fails.

Yes, it is.

Maybe it has something to do with a missing libfreeimage.la / libfreeimageplus.la file.
In 3rdpartypublic/FreeImage I could not find any .la files that seem to be required for libtool to correctly build the shared object.
Without statically linking, all required dynamic libraries should be in the ELF header of the resulting shared object file.
However, if I remove the static linking in Makefile.am, the resulting .so file does not list the FreeImage libraries as dependencies:

$ ldd libmmgr_dal_GPhoto.so.0.0.0
        linux-vdso.so.1 =>  (0x00007fffde5ff000)
        libgphoto2.so.2 => /usr/lib/libgphoto2.so.2 (0x00007f9e0dca8000)
        libltdl.so.7 => /usr/lib/libltdl.so.7 (0x00007f9e0da9e000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f9e0d789000)
        libm.so.6 => /lib/libm.so.6 (0x00007f9e0d506000)
        libc.so.6 => /lib/libc.so.6 (0x00007f9e0d183000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f9e0cf6b000)
        libgphoto2_port.so.0 => /usr/lib/libgphoto2_port.so.0 (0x00007f9e0cd62000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x00007f9e0cb45000)
        libdl.so.2 => /lib/libdl.so.2 (0x00007f9e0c940000)
        libexif.so.12 => /usr/lib/libexif.so.12 (0x00007f9e0c6fb000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f9e0e4d5000)

So whenever the library is loaded, the freeimage*.so dependencies are not loaded, resulting in missing symbols.
I guess if there would be .la files for libfreeimage and libfreeimageplus, libtool should properly link
and the error should be gone.

cheers,
Stefan

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: GPhoto/SimpleCam DeviceAdapter

Johannes Schindelin
Hi,

On Sun, 13 Nov 2011, Stefan Schoenleitner wrote:

> Without statically linking, all required dynamic libraries should be in
> the ELF header of the resulting shared object file. However, if I remove
> the static linking in Makefile.am, the resulting .so file does not list
> the FreeImage libraries as dependencies:
>
> $ ldd libmmgr_dal_GPhoto.so.0.0.0
> linux-vdso.so.1 =>  (0x00007fffde5ff000)
> libgphoto2.so.2 => /usr/lib/libgphoto2.so.2 (0x00007f9e0dca8000)
> libltdl.so.7 => /usr/lib/libltdl.so.7 (0x00007f9e0da9e000)
> libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f9e0d789000)
> libm.so.6 => /lib/libm.so.6 (0x00007f9e0d506000)
> libc.so.6 => /lib/libc.so.6 (0x00007f9e0d183000)
> libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f9e0cf6b000)
> libgphoto2_port.so.0 => /usr/lib/libgphoto2_port.so.0 (0x00007f9e0cd62000)
> libpthread.so.0 => /lib/libpthread.so.0 (0x00007f9e0cb45000)
> libdl.so.2 => /lib/libdl.so.2 (0x00007f9e0c940000)
> libexif.so.12 => /usr/lib/libexif.so.12 (0x00007f9e0c6fb000)
> /lib64/ld-linux-x86-64.so.2 (0x00007f9e0e4d5000)

Maybe "ldd /usr/lib/libgphoto2_port.so.0" should have the dependency on
libfreeimage?

Ciao,
Johannes

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Loading...