473,405 Members | 2,176 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

dlopen

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
12 3352
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
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
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
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
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
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
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
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
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

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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Christopher Armstrong | last post by:
With the following situation, Numarray can't find Python's symbols. problematic-Python:: Main dlopens Two Two dynlinks Python Python dlopens Numarray Numarray dynlinks Python I have another...
1
by: Attila.Rajmund.Nohl | last post by:
Hello! I'm using KAI C++ Compiler (KCC) Version 4.0d on Sparc Solaris 8 with Sun WorkShop 6 update 2 backend (KCC compiles C++ code to C than uses the Sun compiler to produce machine...
2
by: Manuel Maria Diaz Gomez | last post by:
Hi Everybody, maybe you can give me a hint about this. I implemented a simple singleton Factory that will (among other things) keep a registry of objects. Objects register themself in the...
3
by: Matt Churchyard | last post by:
Now I realize this is off topic, and will probably quickly receive a list of replys from people who are quicker to criticize posters than give them help but if you know of a more suitable newsgroup...
2
by: Dave | last post by:
Hi all... I wrote a simple program to test the dlopen()...\ #include <dlfcn.h> int main(int argc, char **argv) { void *handle; double (*cosine)(double); char *error;
12
by: edware | last post by:
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...
10
by: Unknown Soldier | last post by:
Hello, I have a program that makes use of external plugins, implemented as shared libraries loaded at runtime through a call to dlopen(). The libraries export symbols which the main program...
12
by: tvnaidu | last post by:
I am getting this link error, I am using mongoose web server with Linux, any idea?: mongoose.c:3114: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from...
6
by: tvnaidu | last post by:
opening shared lib with dlopen, gets success, but dlsym returns an error saying undefined symbol, also passing "-rdynamic" during linking this shared lib, any idea?. dlopen success, dlsym gets error,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.