RE: Building a metadata importer
RE: Building a metadata importer
- Subject: RE: Building a metadata importer
- From: "Philippe Casgrain" <email@hidden>
- Date: Wed, 23 Aug 2006 15:11:05 -0400
- Thread-topic: Building a metadata importer
This bit me when I updated our Spotlight importer.
If you use C++, your files have to end in .cpp and not .c. You probably
updated GetMetadataForFile.c to contain your C++ code. Rename it to
GetMetadataForFile.cpp, and call the function like this:
#ifdef __cplusplus
extern "C" {
#endif
Boolean GetMetadataForFile(void* thisInterface,
CFMutableDictionaryRef attributes,
CFStringRef contentTypeUTI,
CFStringRef pathToFile)
{
/* Pull any available metadata from the file at the specified path
*/
/* Return the attribute keys and attribute values in the dict */
/* Return TRUE if successful, FALSE if there was no data provided */
// Convert the path to an FSRef
char strTemp[2048];
FSRef fsr;
CFStringGetCString(pathToFile, strTemp, 2048,
kCFStringEncodingASCII);
if (noErr != FSPathMakeRef((unsigned char *)strTemp,
&fsr, NULL))
return FALSE;
// Now that we have our FSRef, parse the RIFF file
return (RIFF_Metadata(&fsr, attributes));
}
#ifdef __cplusplus
}
#endif
Note that RIFF_Metadata() is in an external file, and is C++ code.
Philippe
-----Original Message-----
From: xcode-users-bounces+philippe.casgrain=email@hidden
[mailto:xcode-users-bounces+philippe.casgrain=email@hidden]
On Behalf Of Kevin Meaney
Sent: Wednesday, August 23, 2006 1:10 PM
To: email@hidden
Subject: Building a metadata importer
Hi,
I am having trouble building a spotlight metadata importer. I am getting
a number of errors at link time.
As part of building our application, we build a number of static
libraries. I have added a new target to our application which builds all
the bits needed for the spotlight importer and build a static library.
To get this to work as a first stage I have just created a new XCode
project based on the spotlight template project.
I added our library to the spotlight template project. Implemented the
GetMetadataForFile function and did all the stuff needed for the
Info.plist.
I get a huge number of undefined symbols link error most from the gnu c+
+ standard library. I also get a number of errors for unimplemented C++
class methods of ours which I will have to write empty stubs for and
though tedious that is possible I hope. I'm hoping that name mangling
wont interfere with that.
Originally everything had "Link With Standard Libraries" set for for all
the static libraries and the importer and I got all the errors. I have
tried turning on and off that compiler option for the various libraries
and the spotlight importer without any change. I have also tried turning
on hiding of all symbols except for the required ones and that hasn't
helped any.
Actually when looking at the created library using nm all the functions
and methods are still marked with the uppercase letters. I have tried
removing all intermediate build products that gets built including all
the .o files and architecture libraries built in the build process and I
still get this. So it is not clear whether the "Symbols Hidden by
Default" option is actually doing anything.
Kevin
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
orel.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden