Ran Yakir (rany++at++rtset.co.il)
Sat, 28 Jun 1997 05:52:35 +0300
> hi everybody,
> What's difference to load C++ DSO and C DSO? I have done nicely in
> C,
> but not able to do in C++. It's able to open DSO, but not able to
> locate the
> function in it. :(
You can turn the :( into a :)
The solution is easy. C++ does weird things to function names. It
includes information about the function arguments along with the
original name in the mangled name it is creating. The reason for that is
that C++ wants you to be able to create several functions with similar
names, that does different things, and are distiguished by their
arguments.
The solution is to tell C++ that the external function you're trying to
finc in the DSO, has a good old C style name. This is done by defining a
prototype for that function in the following manner :
extern "C"
{
void myFuncName (void);
}
where myFuncName is the name of your function. If you look at GL/gl.h
for example you'll see that in case of a C++ compilation, all names are
defined as C names.
Ran
--
__ | Ran Yakir
/_) _ __ \ / _ / o __ | 28 Ben Gurion St.
/ )_ (_(_) ) \/ (_(_/<_(_)( | Hod Hasharon 54200
_/ | Israel
-------------------------------------+--------------------------------
At Home : | At Work :
| RT-SET
Voice : +972-9-7489974 | Voice : +972-9-9552236
Fax : +972-9-7422149 | Fax : +972-9-9552239
E-mail : rany++at++netvision.net.il | E-mail : rany++at++rtset.co.il
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:55:31 PDT