[CALUG] gcc question

James Ewing Cottrell 3rd JECottrell3 at Comcast.NET
Fri Feb 3 16:43:44 CST 2006


What you want is an environment variable called something like 
LD_LIBRARY_PATH. RTFM for gcc, ld, and probably ld.so.

You might try using -v on gcc to see exactly which commands are being 
run. You might also need the startup routines, with names like crt0.o.

Let us know what you come up with.

JIM

Jason C. Miller wrote:
> 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 
> _______________________________________________
> Columbia, Maryland Linux User's Group (CALUG) mailing list
> CALUG Website: http://www.calug.com
> Email postings to: lug at calug.com
> Change your list subscription options: http://calug.com/mailman/listinfo""/lug
> 


More information about the lug mailing list