public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Lazy linking.
@ 2008-08-13 19:58 Kirill Pekarov
  2008-08-13 20:26 ` Eljay Love-Jensen
  0 siblings, 1 reply; 3+ messages in thread
From: Kirill Pekarov @ 2008-08-13 19:58 UTC (permalink / raw)
  To: gcc-help

Hi, All.

Please help me with lazy linking in the Linux.

I've ELF executable file with shared library.
The executable load the shared using dlopen() when it need it. The executable also
should work without this shared when the shared is absent, but here I've stuck. A whole day I can't resolve it.

When I run executable with absent shared library - I've error message
at start: 
"./myprog: error while loading shared libraries: libMyprog.so: Cannot open shared object file: No such file or directory".

The question is: What I should tell to the linker to avoid this message?
The executable should work with shared and without it. 
man ld, info gcc and Mr. Google can't help me.

Thanks for any help!

Debian Etch. GCC 4.1.2


-- 
Best regards, 


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

* Re: Lazy linking.
  2008-08-13 19:58 Lazy linking Kirill Pekarov
@ 2008-08-13 20:26 ` Eljay Love-Jensen
  2008-08-14 11:49   ` Re[2]: " Kirill Pekarov
  0 siblings, 1 reply; 3+ messages in thread
From: Eljay Love-Jensen @ 2008-08-13 20:26 UTC (permalink / raw)
  To: kirill_pekarov, GCC-help

Hi Kirill,

It appears that somewhere in your link line, you've made a SSO dependency on
the DLL you wanted to be DSO (via dlopen).

That SSO dependency may be direct (executable directly has SSO dependency on
the DLL) or indirect (some direct SSO itself has a SSO dependency on the
DLL).

Use the ldd command to see the SSO dependencies of your executable.

HTH,
--Eljay

SSO - static shared object
DSO - dynamic shared object
DLL - dynamically loaded library (either SSO at load time, DSO via dlopen)
HTH - hope that helps


On 8/13/08 2:46 PM, "Kirill Pekarov" <kirill_pekarov@valentina-db.com>
wrote:

> Hi, All.
> 
> Please help me with lazy linking in the Linux.
> 
> I've ELF executable file with shared library.
> The executable load the shared using dlopen() when it need it. The executable
> also
> should work without this shared when the shared is absent, but here I've
> stuck. A whole day I can't resolve it.
> 
> When I run executable with absent shared library - I've error message
> at start: 
> "./myprog: error while loading shared libraries: libMyprog.so: Cannot open
> shared object file: No such file or directory".
> 
> The question is: What I should tell to the linker to avoid this message?
> The executable should work with shared and without it.
> man ld, info gcc and Mr. Google can't help me.
> 
> Thanks for any help!
> 
> Debian Etch. GCC 4.1.2
> 

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

* Re[2]: Lazy linking.
  2008-08-13 20:26 ` Eljay Love-Jensen
@ 2008-08-14 11:49   ` Kirill Pekarov
  0 siblings, 0 replies; 3+ messages in thread
From: Kirill Pekarov @ 2008-08-14 11:49 UTC (permalink / raw)
  To: gcc-help

Hi, Eljay.

You wrote 13.08.2008, 22:57:37:

> It appears that somewhere in your link line, you've made a SSO dependency on
> the DLL you wanted to be DSO (via dlopen).

Thank you very much!
Now I see how it should be.


-- 
Best regards,


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

end of thread, other threads:[~2008-08-14  9:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-13 19:58 Lazy linking Kirill Pekarov
2008-08-13 20:26 ` Eljay Love-Jensen
2008-08-14 11:49   ` Re[2]: " Kirill Pekarov

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).