私は、次のようにI/O Kitドライバテンプレートのコードを記述します。私のコードでどのステップを取ってエラーを取り除くことができますか?
#include <IOKit/IOService.h>
class com_osxkernel_driver_IOKitTest : public IOService
{
OSDeclareDefaultStructors(com_osxkernel_driver_IOKitTest)
public:
virtual bool init (OSDictionary* dictionary = NULL);
virtual void free (void);
virtual IOService* probe (IOService* provider, SInt32* score);
virtual bool start (IOService* provider);
virtual void stop (IOService* provider);
};
#include "IOKitTest.h"
#include <IOKit/IOLib.h>
#define super IOService
OSDefineMetaClassAndStructors(com_osxkernel_driver_IOKitTest, IOService)
bool com_osxkernel_driver_IOKitTest::init (OSDictionary* dict)
{
bool res = super::init(dict);
IOLog("IOKitTest::init\n");
return res;
}
void com_osxkernel_driver_IOKitTest::free(void)
{
IOLog("IOKitTest::free\n");
super::free();
}
IOService* com_osxkernel_driver_IOKitTest::probe (IOService* provider, SInt32* score)
{
IOService *res = super::probe(provider, score);
IOLog("IOKitTest::probe\n");
return res;
}
bool com_osxkernel_driver_IOKitTest::start (IOService *provider)
{
bool res = super::start(provider);
IOLog("IOKitTest::start\n");
return res;
}
void com_osxkernel_driver_IOKitTest::stop (IOService *provider)
{
IOLog("IOKitTest::stop\n");
super::stop(provider);
}
私はこのコードをビルドすると、私は4エラーを取得:関数宣言子 後
- 期待される機能本体を
stray '\357' in program
stray '\277' in program
stray '\274' in program
あなたはエラーが発生しますか?
質問の書式を改善する必要があります。現時点では判読できません。 –
ありがとうございましたChriatofer Eliasson – kumar
@MedetiNaveenKumar答えがあなたの問題を解決した場合は、それを合格とマークしてください。そうでない場合は、さらに情報を提供する必要があります。これはあなたのすべての質問に役立ちます。 – pmdj