Last month post by Ben Combee is included below:

Still my question is how can I atleast use C++ minus item 1 & 2 with the
code generated by the CW 8 Shared Lib Wizard? Or do I need to take some
other path?

-AS


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Ben
Combee
Sent: Saturday, April 20, 2002 2:09 AM
To: Palm Developer Forum
Subject: Re: Shared Libraries and C++

C++ code isn't going to work very well in a shared library?

Why?  Here's three reasons:

1) Shared libraries don't have global variables, so no virtual function
tables, exceptions, or RTTI.

2) Calls into shared library routines have a required first parameter
that is the library reference number.  C++ method calls have an implicit
first parameter than is the this pointer.  Result: C++ methods can't be
exported as shared library calls.

3) Shared libraries aren't initialized through the CodeWarrior runtime.
No static object initialization, and since there are no globals, no
stack of objects to destroy when the library is closed.  (This is the
source of the __InitCode__ error you're seeing above).

You can use C++ source files with a shared library, but some of the
language features just don't get along well with the shared library
runtime model.



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to