Thanks Ben for your answer. Well, I did read the article. The shared library is written in C. Even though my application uses C++, but I use C convention to call any methods in the shared library.

#ifdef __cplusplus
extern "C" {
#endif

// calls to shared library

#ifdef __cplusplus
extern "C" {
#endif

Should not it work?

Thanks,
Jenni


----- Original Message ----- From: "Ben Combee" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <palm-dev-forum@news.palmos.com>
Sent: Wednesday, March 09, 2005 10:28 AM
Subject: Re: problem with shared library ... linking error



At 07:24 AM 3/9/2005, you wrote:
Hello Everybody,

I am having a problem with using shared library in Codewarrior, and it is hapenning during link time. I have included the header file that has all the necessary APIs exposed for the shared library. However, the linker gives error for SOME of them (NOT for ALL):
TManager:: 'T_free' referenced from 'TManager::TFree' is undefined.


How come other APIs are not causing any linking error and only this one (T_free) doing that. Here is a portion of the APIs for the shared library listed:

UInt32 T_reset();
UInt32 T_free();
UInt32 T_setParams (UInt16 controlID, UInt32 controlVal);

FYI, the T_reset and T_setParams are not causing any errors. I thought the linker did not need to link to the APIs during linking. Is there any setting in CodeWarrior that I need to do?

Thanks for your valuable time.

Palm OS 68K shared libraries don't support C++ -- did you read my article at palmos.combee.net about this topic? The shared library model on Palm OS just can't support C++ methods because of the conflict between the hidden this pointer and the library reference in the parameter lists.



-- Ben Combee, Senior Software Engineer, palmOne, Inc. "Combee on Palm OS" weblog: http://palmos.combee.net/ Developer Forum Archives: http://news.palmos.com/read/all_forums/


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



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

Reply via email to