static link a library

A

Angel Lopez

I am quite a beginner in C. I am writting an application on my debian
linux computer that uses some imagemagick library functions. I can
link them and compile (with cc) in my computer but when I move the
binary to another computer it says: error while loading shared
library: libWand.so.6: cannot open shared object file: No such file or
directory.
I would like to avoid this and (if possible ) have everything compiled
into my binary. I think I have to link a static version of imagemagick
library but I don't know how to do this. I would appreciate if someone
could point me to tutorials or manuals for beginners (preferentially
free and online) on how to link static libraries or give me a short
explanation.
Thanks,
Angel
 
C

Chris Barts

I am quite a beginner in C.

And, apparently, to Usenet.
I am writting an application on my debian linux computer that uses some
imagemagick library functions.
[snip OT]

You would do best to ask in comp.unix.programmers or gnu.gcc.help. Or,
even better, run info gcc or man gcc and see what the documentation says
about static linking.

This group is about Standard C, not the options present on specific C
compilers.
 
A

ajay

I am quite a beginner in C. I am writting an application on my debian
linux computer that uses some imagemagick library functions. I can
link them and compile (with cc) in my computer but when I move the
binary to another computer it says: error while loading shared
library: libWand.so.6: cannot open shared object file: No such file or
directory.
I would like to avoid this and (if possible ) have everything compiled
into my binary. I think I have to link a static version of imagemagick
library but I don't know how to do this. I would appreciate if someone
could point me to tutorials or manuals for beginners (preferentially
free and online) on how to link static libraries or give me a short
explanation.
Thanks,
Angel

The best and the least thing you can do is look the man page of cc/gcc
for the static linking options. With gcc, "-static" option is probably
what you are looking for.

- ajay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top