Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

naveen

macrumors member
Original poster
Oct 27, 2004
43
0
Hi all

I have to use the following API

extern OSErr FSpCreate(
const FSSpec * spec,
OSType creator,
OSType fileType,
ScriptCode scriptTag )

I have declared the following
FSSpec *spec;
spec->vRefNum=0;
spec->parID=2;
unsigned char filename[64]="Aman";
spec->name=filename;
OSType creator="PTul";
OSType fileType="Sd2f";
ScriptCode scriptTag="smSystemScript";

I have include the path Of "Files.h".
There is no error upto this point But when i call the FSpCreate(spec,creator,fileType,scriptTag);
then there is following error :-

ld: form3.o illegal reference to symbol: _FSpCreate defined in indirectly referenced dynamic library /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore

I have to include the CarbonLib 1.0 but this lib file available in more than one directory.Which Path should I have to include? Plz help me.

Thanks and Regards
 
hmm

Have you added something like this to your .pro file?

mac:LIBS += /System/Library/Frameworks/Carbon.framework/Carbon

You might also want
mac:LIBS += /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation

I don't know anything about Carbon, so this is just a shot in the dark. Basically the first thing to do is make ensure that you have specified all of the frameworks that need to be linked in; that's the usual cause of this.
 
Hi all

I have included the lib file and now when i compiling my application there is no error but still file is not created.I want to know about the FSSpec structure.

I have passed the following values to this structure :-
spec.vRefNum=0;
spec.parID=4029;
unsigned char filename[64]="Aman";
spec.name=filename;
FSpCreate(&spec, 'ttxt', 'TEXT', smSystemScript); *

I want to create file on root . What i should pass to parId and vRefNum?? How i can get the Volume reference number.

Thanks and Regards
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.