-1
我正在爲Leopard OS編寫上下文菜單插件,並提及SampleCMPlugIn。它的工作正常。現在我想從這個插件調用可可功能,但是當我將可可框架添加到我的項目幷包括到源文件中時,我得到了10874錯誤。碳類中的可可骨架
/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:126:0 /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:126: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:127:0 /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:127: error: expected ')' before '*' token
/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:129:0 /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:129: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
編輯:
當我改變從.C我的源代碼文件擴展名.mm通過Michael Dautermann的建議,我有5個錯誤:
/Users/path/SampleCMPlugIn.mm:826:0 /Users/path/SampleCMPlugIn.mm:826: error: invalid conversion from 'const void*' to 'const __CFUUID*'
/Users/path/SampleCMPlugIn.mm:1228:0 /Users/path/SampleCMPlugIn.mm:1228: error: jump to label 'SampleSubMenu_Create_Complete_fail'
/Users/path/SampleCMPlugIn.mm:1140:0 /Users/path/SampleCMPlugIn.mm:1140: error: from here
/Users/path/SampleCMPlugIn.mm:1143:0 /Users/path/SampleCMPlugIn.mm:1143: error: crosses initialization of 'int disableMainMenu'
/Users/path/SampleCMPlugIn.mm:1142:0 /Users/path/SampleCMPlugIn.mm:1142: error: crosses initialization of 'int count'
任何人都可以請幫助我出去了?
我正在使用豹OS和該代碼在豹OS上工作正常。有什麼辦法可以調用可可功能嗎? – 2012-01-05 14:47:10
我想你確定你想繼續與你在做什麼。如果您的代碼的文件擴展名(您要調用Cocoa函數的位置)是.c或.cpp,請將其更改爲.mm(對於Objective C++),並查看編譯問題是否消失。如果他們不這樣做,請修改您的問題以包含項目窗口外觀的截圖,以便我們瞭解您的框架。 – 2012-01-05 14:55:26
我只有SampleCMPlugIn.c文件,我將SampleCMPlugIn.c擴展名更改爲.mm,現在我得到5個錯誤。 – 2012-01-05 15:03:37