By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,558 Members | 1,373 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,558 IT Pros & Developers. It's quick & easy.

dlopen

P: n/a
I've seen the dlopen() function in code I've read,
is that a C or C++ function? Is it a standard function?

In case it is a topical question, what is the advantage
of using it instead of let the linker do the job?
Apr 25 '06 #1
Share this Question
Share on Google+
12 Replies


P: n/a
edware wrote:
I've seen the dlopen() function in code I've read,
is that a C or C++ function? Is it a standard function?
No.
In case it is a topical question, what is the advantage
of using it instead of let the linker do the job?


Look up "shared objects" or "dynamically linked libraries" on the Web.
The advantage of using them versus static linking should be explained
on those pages.

V
--
Please remove capital As from my address when replying by mail
Apr 25 '06 #2

P: n/a
edware said:
I've seen the dlopen() function in code I've read,
is that a C or C++ function? Is it a standard function?
No, it's an extension offered by typical Unix-based compilers.
In case it is a topical question, what is the advantage
of using it instead of let the linker do the job?


The advantage of letting the linker do the job is that the code is not
rendered less portable by the introduction into it of a non-standard
function.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Apr 25 '06 #3

P: n/a
edware wrote:
I've seen the dlopen() function in code I've read,
is that a C or C++ function? Is it a standard function?

In case it is a topical question, what is the advantage
of using it instead of let the linker do the job?


Try posting to one of these newsgroups:

comp.os.linux.development.system

comp.os.linux.development.apps

Regards,
Larry
Apr 25 '06 #4

P: n/a
Richard Heathfield wrote:
The advantage of letting the linker do the job is that the code is not
rendered less portable by the introduction into it of a non-standard
function.


What a useless sophistry. Nobody has the burden of writing all their C++
code to be topical to this newsgroup.

The advantage of using your OS's dynamic linker is simply more support at
failure time, and less fragile code.

--
Phlip
http://www.greencheese.org/ZeekLand <-- NOT a blog!!!
Apr 25 '06 #5

P: n/a
Larry I Smith wrote:
edware wrote:
I've seen the dlopen() function in code I've read,
is that a C or C++ function? Is it a standard function?

In case it is a topical question, what is the advantage
of using it instead of let the linker do the job?

Try posting to one of these newsgroups:

comp.os.linux.development.system

comp.os.linux.development.apps

comp.unix.programmer would be a more generic choice.

--
Ian Collins.
Apr 25 '06 #6

P: n/a
Phlip opined:
Richard Heathfield wrote:
The advantage of letting the linker do the job is that the code is
not rendered less portable by the introduction into it of a
non-standard function.
What a useless sophistry. Nobody has the burden of writing all their
C++ code to be topical to this newsgroup.


What a useless comment in comp.lang.c (although I suspect in ++, too)!

And, pray tell, why did you feel the need to set followups to c.l.c?

Followups re-set to comp.lang.c++
The advantage of using your OS's dynamic linker is simply more
support at failure time, and less fragile code.


I guess this would be OT in both...

--
if (argc > 1 && strcmp(argv[1], "-advice") == 0) {
printf("Don't Panic!\n");
exit(42);
}
(Arnold Robbins in the LJ of February '95, describing RCS)

<http://clc-wiki.net/wiki/Introduction_to_comp.lang.c>

Apr 25 '06 #7

P: n/a
edware wrote:
I've seen the dlopen() function in code I've read,
is that a C or C++ function? Is it a standard function?
Yes. It conforms to POSIX 1003.1-2003.
In case it is a topical question, what is the advantage
of using it instead of let the linker do the job?


More flexibility. You can at runtime check wether certain libraries are
available and fall back to a default or just reduce functionality if
some are missing.

Apr 25 '06 #8

P: n/a
Markus Schoder wrote:
edware wrote:
I've seen the dlopen() function in code I've read,
is that a C or C++ function? Is it a standard function?

Yes. It conforms to POSIX 1003.1-2003.


Which is neither the C or C++ standard!

--
Ian Collins.
Apr 25 '06 #9

P: n/a
Vladimir Oka said:
Phlip opined:
Richard Heathfield wrote:
The advantage of letting the linker do the job is that the code is
not rendered less portable by the introduction into it of a
non-standard function.
What a useless sophistry. Nobody has the burden of writing all their
C++ code to be topical to this newsgroup.


What a useless comment in comp.lang.c (although I suspect in ++, too)!

And, pray tell, why did you feel the need to set followups to c.l.c?


He didn't. Your newsreader probably presented you with a default followup
option. You are the first to set followups in this discussion.

Phlip was quite wrong about the utility of my "sophistry", but he did not
try to hack the followups.
Followups re-set to comp.lang.c++


Followups cleared until it is evident where this discussion belonged.
The advantage of using your OS's dynamic linker is simply more
support at failure time, and less fragile code.


I guess this would be OT in both...


Whereas my "useless sophistry" was both topical and potentially useful in
both groups.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Apr 25 '06 #10

P: n/a

Richard Heathfield wrote:
Vladimir Oka said:
Phlip opined:
Richard Heathfield wrote:

The advantage of letting the linker do the job is that the code is
not rendered less portable by the introduction into it of a
non-standard function.

What a useless sophistry. Nobody has the burden of writing all their
C++ code to be topical to this newsgroup.
What a useless comment in comp.lang.c (although I suspect in ++, too)!

And, pray tell, why did you feel the need to set followups to c.l.c?


He didn't. Your newsreader probably presented you with a default followup
option. You are the first to set followups in this discussion.


Ooops. That's quite possible.
Phlip was quite wrong about the utility of my "sophistry", but he did not
try to hack the followups.


Apologies.
Followups re-set to comp.lang.c++


Followups cleared until it is evident where this discussion belonged.


Fair enough (although I have a sneaky suspicion).
The advantage of using your OS's dynamic linker is simply more
support at failure time, and less fragile code.


I guess this would be OT in both...


Whereas my "useless sophistry" was both topical and potentially useful in
both groups.


No quibble with that.

Apr 25 '06 #11

P: n/a
Vladimir Oka said:
Richard Heathfield wrote:
Vladimir Oka said:
> Followups re-set to comp.lang.c++


Followups cleared until it is evident where this discussion belonged.


Fair enough (although I have a sneaky suspicion).


How does alt.dev.null sound to you? :-)

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Apr 25 '06 #12

P: n/a
Richard Heathfield wrote:
Whereas my "useless sophistry" was both topical and potentially useful in
both groups.


I'm sowwweee. I shall reduce my appraisal to just "sophistry".

;-)

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
Apr 25 '06 #13

This discussion thread is closed

Replies have been disabled for this discussion.