Several of the palmOne shared libraries have a version function with the
following signature:
Err PalmPhotoLibGetVersion (UInt16 refNum, UInt32 sdkVersion, UInt32
*libVersionP)
I have declared a table with some pointers to functions having that signature:
typedef struct {
UInt32 type;
UInt32 creator;
char* internalName;
char* humanName;
Err (*GetVersion) (UInt16 refNum, UInt32 sdkVersion, UInt32
*libVersionP);
} PalmOneLibRec;
#define NUM_PALMONE_SHARED_LIB 2
PalmOneLibRec palmOneSharedLibs[] = {
{PalmPhotoLibTypeID , PalmPhotoLibCreatorID, PalmPhotoLibName ,
"palmOne Photo", &PalmPhotoLibGetVersion},
{kCamLibType, kCamLibCreator, kCamLibName, "palmOne Camera Mgr",
&CamLibGetVersion},
};
However, the above code fails to compile, with the error message
undefined reference to `PalmPhotoLibGetVersion'
If I declare a helper function:
Err CallPalmPhotoLibGetVersion(UInt16 refNum, UInt32 sdkVersion, UInt32
*libVersionP) {
return PalmPhotoLibGetVersion(refNum, sdkVersion, libVersionP);
}
I can put a pointer to this function in my table, without any problem.
Obviously, functions in shared libraries are not quite the same as functions in
my code, but is there a way to use pointers to functions in shared libraries,
without declaring helper functions?
[I'm using prc-tools (m68k-palmos-gcc is version 2.95.3-kgpd) under OS X 10.3.9]
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/