Errors trying to compile the simplest sora code
-
giovedì 6 maggio 2010 21:52
I am trying to compile in Visual Studio 2008 the following code
after installing the SORA package.
------------------------------
#include <sora.h>
main()
{
}-----------------------------
I have already added the directory paths
"C:\Program Files\Microsoft Research Asia\SoraSDK\inc";
The compiler produces an error asking for additional header files
(ntdkk.h, etc)
After installing the windkk package and adding the include files
C:\WinDDK\7600.16385.1\inc\api;C:\WinDDK\7600.16385.1\inc\ddk
C:\WinDDK\7600.16385.1\inc\api;C:\WinDDK\7600.16385.1\inc\api
the compiler gives multiple unexpected errors in the standard c header files:
1>------ Build started: Project: sora_hello_world, Configuration: Debug Win32 ------
1>Compiling...
1>hello_world.c
1>c:\program files\microsoft visual studio 9.0\vc\include\excpt.h(60) : error C2143: syntax error : missing ')' before 'type'
1>c:\program files\microsoft visual studio 9.0\vc\include\excpt.h(60) : error C2085: '_ExceptionRecord' : not in formal parameter list
1>c:\program files\microsoft visual studio 9.0\vc\include\excpt.h(61) : error C2143: syntax error : missing ';' before 'type'
1>c:\program files\microsoft visual studio 9.0\vc\include\excpt.h(61) : error C2085: '_EstablisherFrame' : not in formal parameter list
1>c:\program files\microsoft visual studio 9.0\vc\include\excpt.h(62) : error C2085: '_Inout_' : not in formal parameter list
1>c:\program files\microsoft visual studio 9.0\vc\include\excpt.h(62) : error C2143: syntax error : missing ';' before 'type'
1>c:\program files\microsoft visual studio 9.0\vc\include\excpt.h(62) : error C2085: '_ContextRecord' : not in formal parameter list
1>c:\program files\microsoft visual studio 9.0\vc\include\excpt.h(63) : error C2085: '_Inout_' : not in formal parameter list
1>c:\program files\microsoft visual studio 9.0\vc\include\excpt.h(63) : error C2143: syntax error : missing ';' before 'type'
1>c:\program files\microsoft visual studio 9.0\vc\include\excpt.h(64) : error C2059: syntax error : ')'...
Could you please help us get past this initial problems.
Thanks
Achilleas
Tutte le risposte
-
martedì 11 maggio 2010 03:17Moderatore
For kernel-mode build, please start from WinDDK build evironment. That is, windows driver kit-> WDK xxxx ->build environment -> win xp.
For user-mode build, please predefine macro USER_MODE.
Thanks.
-
martedì 11 maggio 2010 21:59
OK, the following code now compiles/links but when executed aborts with:
"The application failed to initialize properly (0xc0000005)....)"
"Unhandled exception at 0x7c9666c6 in sora_hello_world.exe: 0xC0000005: Access violation."
BTW, we link with
C:\Program Files\Microsoft Research Asia\SoraSDK\lib\free\ksora.lib
and
C:\WinDDK\7600.16385.1\lib\wxp\i386\wdm.lib
Any thoughts as to what we are doing wrong?
Achilleas
================
#define USER_MODE
#include <sora.h>
main()
{
SORA_RADIO radio;
IN ULONG nRadio = 1; // request 1 radio
IN PCWSTR UserName = L"some_user";
HRESULT result=666;
result = SoraAllocateRadioFromRCBDevice(&(radio.RadiosList), nRadio, UserName);}
==============
-
mercoledì 12 maggio 2010 02:40Moderatore
SoraAllocateRadioFromRCBDevice is only for kernel mode driver. User mode program can not access the hardware directly.
Actually we provide usora.lib for user to unit test their wireless physical layer in user mode program.
thanks.
-
mercoledì 12 maggio 2010 02:46Moderatore
SoraAllocateRadioFromRCBDevice should be used as:
LIST_ENTRY ListHead;
IN ULONG nRadio = 1; // request 1 radio
IN PCWSTR UserName = L"some_user";
HRESULT result=666;
result = SoraAllocateRadioFromRCBDevice(&ListHead, nRadio, UserName);After return, ListHead is the double linked list head for all allocated radios.
thank you for the trial.
-
mercoledì 12 maggio 2010 03:10
So in order to compile/link/execute in kernel mode, what exactly should i do?
Can you elaborate on your previous comment:
"For kernel-mode build, please start from WinDDK build evironment. That is, windows driver kit-> WDK xxxx ->build environment -> win xp."
The following code (when i do not define USER_MODE) requires inclusion of
C:\WinDDK\7600.16385.1\inc\ddk\ntddk.h
and
C:\WinDDK\7600.16385.1\inc\api\ntdef.h
but after the last header is included it results in multiple redefinition errors:
1>------ Build started: Project: sora_hello_world, Configuration: Debug Win32 ------
1>Compiling...
1>hello_world.c
1>c:\program files\microsoft visual studio 9.0\vc\include\excpt.h(60) : error C2143: syntax error : missing ')' before 'type'
1>c:\program files\microsoft visual studio 9.0\vc\include\excpt.h(60) : error C2085: '_ExceptionRecord' : not in formal parameter list
1>c:\program files\microsoft visual studio 9.0\vc\include\excpt.h(61) : error C2143: syntax error : missing ';' before 'type'
1>c:\program files\microsoft visual studio 9.0\vc\include\excpt.h(61) : error C2085: '_EstablisherFrame' : not in formal parameter list
1>c:\program files\microsoft visual studio 9.0\vc\include\excpt.h(62) : error C2085: '_Inout_' : not in formal parameter list
1>c:\program files\microsoft visual studio 9.0\vc\include\excpt.h(62) : error C2143: syntax error : missing ';' before 'type'.....
====================
#include <sora.h>
main()
{
LIST_ENTRY entry;
IN ULONG nRadio = 1; // request 1 radio
IN PCWSTR UserName = L"some_user";
HRESULT result=666;
result = SoraAllocateRadioFromRCBDevice(&entry, nRadio, UserName);}
=====================
Thank you for your help,
Achilleas
-
mercoledì 12 maggio 2010 06:03Moderatore
In C:\WinDDK\7600.16385.0\src\network\ndis\netvmini, there are windows driver samples. If you only try compile/link, add sora api call in these sample code.
Use build.exe in build environment, instead of visual studio.
- Contrassegnato come risposta Qiufeng YINMicrosoft Employee, Owner giovedì 13 maggio 2010 01:25