[CALUG] gcc question

Jason C. Miller jason.c.miller at gmail.com
Tue Jan 17 06:12:14 CST 2006


Here's a question for all you coders out there.  I'm one of those people who
is used to building a coding environment and then coding around it.  I'm not
really all that used to having to build an environment around
already-written code.  So, here's my question....

I have some code that dynamically links to various libraries around the
system.  BTW, this is a Solaris 8 box and static linking isn't an option.
What I want to do is to copy all of those various libraries into the
directory where the new executable will reside and link to those.
Basically, I just want to be able to package up the directory and send it
off to anybody who wants to use it without requiring them to do any funky
post install.

So, in short....

# pwd
/code/test
# make
     gcc -I<whatever> -L<whatever> -l<whatever> code.c -o code
# ldd code
          libWhatever.so.2   => ./libWhatever.so.2
          libUseless.so.1 => ./libUseless.so.1
          libBlah.so.5 => libBlah.so.5

I've been told that I can do this.  However, I really don't know the right
buzzwords to google for without returning a million irrelevant results.  Is
this a function of gcc or ld?  And also, which argument(s) should I look at?

                                                                    -j

P.S. Anyone who tells me to "man gcc" hasn't read the entire gcc manual page
before  :)


--
**************************************
http://millersplace.blogspot.com/
**************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://calug.com/pipermail/lug/attachments/20060117/853926eb/attachment.html 


More information about the lug mailing list