I'm new to Win environment, trying to write code which use win kernel API but on Ubuntu 10.04 ... using mingw32 (more specifically, i586-mingw32msvc)
My code:
#include<ddk/winddk.h>
int main()
{
return 0;
}
But I'm getting to many errors with ddk/winddk.h header: Compiling as: i586-mingw32msvc-gcc WaitForSingleObj_2.c
All errors are like this:
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/ddk/winddk.h:9208: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'NTSTATUS'
Am I missing something for this? As I tried to compile with headers iostream and windows.h, that works fine.
EDIT:
#include<ntdef.h>
#include<ddk/ntddk.h>
#include<ddk/winddk.h>
#include<ddk/ntddndis.h>
int main()
{
KTIMER *timer;
KeInitializeTimer(timer);
return 0;
}
till KTIMER its fine, now new error: /tmp/cc0epAQA.o:WaitForSingleObj_2.c:(.text+0x1d): undefined reference to `_imp_KeInitializeTimer@4' collect2: ld returned 1 exit status
Can anyone tell me, now which header file to include plz?
Edit: [As others commented already, and I experienced(!) PLEASE try to avoid using other platform for Windonws Kernel development]
I switched to Visual C++ Express, downloaded WDK, given additional include path from Project Property->c/c++ .. ->Additional Include directory (C:\WinDDK\7600.16385.1\inc\ddk;C:\WinDDK\7600.16385.1\inc\api;)
BUT (I hate this but!) I'm getting many compiling error like
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\crtdefs.h(543): error C2143: syntax error : missing ')' before 'const'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\crtdefs.h(543): error C2143: syntax error : missing '{' before 'const'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\crtdefs.h(543): error C2059: syntax error : ','
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\crtdefs.h(543): error C2059: syntax error : ')'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\crtdefs.h(550): error C2143: syntax error : missing ')' before 'const'
My Code:
#include <wdm.h>
int mian()
{
/*
* PKTIMER Timer;
*/
}
If anyone has idea please help!