Page 1 of 1

static linking Magick++ executable

Posted: 2013-07-03T22:28:11-07:00
by sol
hi,
after compiling a very simple, first time Magick++ application with an installation
of ImageMagick that i have installed in my home directory on a server that i do
not have root access to, i find that the libraries cannot be found at run time, and
messing around with ldconfig, using local cache file etc doesnt help. i am not an
expert in these matters, but i decide it would be good to link, instead, statically
to the ImageMagick libraries so that they will be built in and so no runtime problem.
but there are many things that the linker cannot find now, even though the .a
files are present in my build of Imagemagick. i have read other stuff in the forums
and it seems that i cannot just link the .a files, and so i dont understand why there
is an option to build them when installing ImageMagic, if they are no use without
statically including the other delegate libraries as well...?

basically i would really like to know how to either dynamically link the right libraries
so that they can be found at runtime by the program, or statically link them into
the program. sorry if i have not described the problem well..

Re: static linking Magick++ executable

Posted: 2013-07-04T23:35:17-07:00
by sol
...well i can run it with the right libraries using:

/lib64/ld-2.12.so --library-path ../../local/lib ./program

...would be good to know about the static libraries though...

Re: static linking Magick++ executable

Posted: 2013-07-06T20:08:18-07:00
by sol
...okay please please maybe an answer to this...
...a simplified version of the original question :

ok i have the shared libraries in my installation of Image Magick,
and i am using them successfully in a compiled Magick++ program
that i am writing that draws pictures. no problem. but... what is
the purpose of the static libraries that built (the .a files) if they
cannot be linked into my program when i am compiling it?
maybe i'm wrong but everthing i have read seems to say it is
impossible unless they themselves are compiled statically with
all the libraries that they use statically too.

just would like to know where to start looking about how to use
them... can they be used in a Magick++ application comiled
with g++ ? and if so how?

if this is stupid question, sorry.

thanks