0

我正在尝试将 Windows FileMaker 插件移植到 OS X 并认为我应该在 Cocoa 而不是 Carbon 中执行此操作,

但是一旦包含 Cocoa.h,我就很难编译任何东西

4

2 回答 2

2

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.

于 2009-11-24T22:39:17.970 回答
0

实际上 FileMaker 框架是 C++。您可以混合使用 C++ 和 Objective-C 代码,这样您就可以使用 Cocoa 而不是 Carbon。请注意该文件将是 .mm 而不是 .m

对 C++ 框架的 Objective-C 包装器将使使用 .m Objective-C 成为可能。不幸的是,我对 C++ 完全一无所知(并希望留下来),所以这超出了我的能力范围。

于 2010-03-05T18:17:06.143 回答