views:

121

answers:

2

I am trying to port a Windows FileMaker plugin to OS X and am thinking that I should be doing this in Cocoa not Carbon, but I am struggling to get anything to compile as soon as I include Cocoa.h

+1  A: 

Are you importing it into a .c file? Cocoa requires Objective-C, so you'll need to rename any files you want to import its header into from .c to .m.

Of course, how practical that is depends on FileMaker's plug-in API on the Mac (assuming it has one). If the API, including UI hooks, is entirely Carbon-based, switching the plug-in's source to Cocoa may be futile. I can't say for sure without knowing that API.

Peter Hosey
Ah I'll give that a try then, the files have a .c extension at the moment.Yes FileMaker does have a plugin API, but it uses Carbon, but considering I am only just starting to develop OS X FileMaker Plugins and carbon support is slowly being dropped from OS X, I thought it would be more sense to try and learn Cocoa instead.
Adam Dempsey
A: 

Actually the FileMaker Framework is C++. You can mix C++ and Objective-C code so you could use Cocoa instead of Carbon. Beware that the file would be .mm not .m

An Objective-C wrapper to the C++ framework would make it possible to use .m Objective-C. Unfortunately I'm totally ignorant of C++ (and expect to stay) so it is beyond my competence.

team-rf