public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Adding a library
@ 2006-06-20  3:00 Vivek Katakam
  2006-06-20  4:41 ` Ingo Krabbe
  0 siblings, 1 reply; 2+ messages in thread
From: Vivek Katakam @ 2006-06-20  3:00 UTC (permalink / raw)
  To: gcc-help

Hi All,
I have a problem at Linker stage in the compilation process.

If I include libsqlplus.so as -lsqlplus it is generating the binary
otherwise it is the giving undefined reference to sqlca function.

I have also given the LD_LIBRARY_PATH etc. Because I have to change at
lot number of places , is there a way around so that i can dynamically
include this library for example through ranlib.

Regards,
Vivek

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Adding a library
  2006-06-20  3:00 Adding a library Vivek Katakam
@ 2006-06-20  4:41 ` Ingo Krabbe
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Krabbe @ 2006-06-20  4:41 UTC (permalink / raw)
  To: gcc-help; +Cc: Vivek Katakam

Am Dienstag, 20. Juni 2006 04:59 schrieb Vivek Katakam:
> Hi All,
> I have a problem at Linker stage in the compilation process.
>
> If I include libsqlplus.so as -lsqlplus it is generating the binary
> otherwise it is the giving undefined reference to sqlca function.
>
> I have also given the LD_LIBRARY_PATH etc. Because I have to change at
> lot number of places , is there a way around so that i can dynamically
> include this library for example through ranlib.


have you tried -Wl,-rpath,[PATH TO libsqlplus] as a LDFLAG while linking ?  
Then you don't need to set LD_LIBRARY_PATH in your environment, but the 
binary will know on its own how to find the library.  You have to think twice 
about this topic, when you want to enable others to use your project to make 
the executables.  In general, all linker options are accesible through 
gcc's -Wl flag followed by the linker flag.

>
> Regards,
> Vivek

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-06-20  4:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-20  3:00 Adding a library Vivek Katakam
2006-06-20  4:41 ` Ingo Krabbe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).