On Sat, Jul 16, 2016 at 6:20 AM,  <dan...@basereality.com> wrote:
>
> Can anyone tell me what I'm doing wrong when building a go program that uses
> the ImageMagick library that has been installed to a non-standard location.
>
> What I think I'm seeing is that the program builds, but a flag telling the
> program to look in the non-standard location for the dynamic library isn't
> set _somewhere_ and so the program fails to be able to locate the library.
>
> Steps to reproduce are:
>
> Configure ImageMagick to install to a non-standard directory and build it:
> # ./configure --prefix="/temp/imagemagick-temp" --without-magick-plus-plus
> --without-perl --disable-openmp --with-gvc=no
> # make install
>
> Add the pkgconfig directory to PKG_CONFIG_PATH so that pkg-config can find
> it.
> # export PKG_CONFIG_PATH=/temp/imagemagick-temp/lib/pkgconfig
>
> Check that pkg-config is happy and can find it:
> # pkg-config --cflags --libs MagickWand MagickCore
> -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16
> -I/temp/imagemagick-temp/include/ImageMagick-6  -L/temp/imagemagick-temp/lib
> -lMagickWand-6.Q16 -lMagickCore-6.Q16

I don't see anything in this output that will tell the program where
to find the shared library.  I would expect this to fail the same way
if you were building a C program that used the library.

My guess is that you need to either pass -R /temp/imagemagick-temp/lib
to the linker, which you can do by setting CGO_LDFLAGS, or you need to
add that directory to the list of directories that the dynamic linker
searches--see `man ldconfig`.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to