Change your .c files to .m. Then you can use objective-c calls _in_ your C code.
Objective C is a proper superset of C, and so you just need to inform the compiler of your intent by changing the file extension(s). Kirk Kerekes (iPhone) > Message: 1 > Date: Fri, 13 Nov 2020 11:16:23 -0800 > From: Carl Hoefs <newsli...@autonomy.caltech.edu> > To: cocoa-dev <cocoa-dev@lists.apple.com> > Subject: Cocoa dylib access by C program > Message-ID: > <356d1145-0bbb-4dd6-a424-9ac48d98a...@autonomy.caltech.edu> > Content-Type: text/plain; charset=us-ascii > > I have built an ObjC/Cocoa/Foundation library.dylib; it works well when > linked with ObjC apps. > > But now I need to link a C program against that library. How do I invoke the > ObjC library methods from a C program? (I know I can add C function entry > points to the library, but how do they invoke the internal ObjC library > methods?) > > -Carl _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com