Q33NY
2010-07-22 09:16:10 UTC
Hi,
I've posted this question on the VC++ general forum but someone instructed
me to post it here.
I have a cpp program that uses ntddk.h(located in
$(DDK_INSTALL_DIR)\inc\ddk\wnet) - the ddk version is 3790.1830. I am trying
to compile it using MsVStudio2005(via project or Makefile). It works for
target machine X86 and IA64, but when i try to compile it for AMD64, i get
this error:
E:\WINDDK\3790.1830\inc\ddk\wnet\ntddk.h(10139) : error C4430: missing type
specifier - int assumed. Note: C++ does not support default-int
the compiler command is(and the vcvars are set to x86_amd64):
cl /nologo /GS /DWIN32 /D_WIN32 /W3 /D_WINNT /EHsc /c /DZLIB_WINAPI /DNDEBUG
/D_MBCS /MT /D_MT /X /TP /Wp64 /D_AMD64_=1 /DWIN64 /D_WIN64 /I "E:\Program
Files\Microsoft Visual Studio 8\VC\include" /I "E:\Program Files\Microsoft
Platform SDK for Windows Server 2003 R2"\Include /I "E:\Program
Files\Microsoft Platform SDK for Windows Server 2003 R2"\Include\crt /I
.\zlib\include /I E:\WINDDK\3790.1830\inc\ddk\wnet /I
E:\WINDDK\3790.1830\inc\wnet .\Process.cpp /Fo".\int_x64\Process.obj"
Process.cpp
Indeed when i took a look in ntddk.h file i found this:
The following piece of code starts at line 10129:
#define ExInterlockedExchangeUlong(Target, Value, Lock) \
_ExInterlockedExchangeUlong(Target, Value)
__forceinline
//ULONG
_ExInterlockedExchangeUlong (
IN OUT PULONG Target,
IN ULONG Value
)
{
return (ULONG)InterlockedExchange((PLONG)Target, (LONG)Value);
}
It's clear that the return type is missing(I added the "//ULONG" line there
and if i decomment that, it compiles fine on AMD64).
Is this a known issue? Is simply adding the return type a workaround that Ms
encourages?
Note: There's another workaround, using another compiler(well with slightly
different flags) - the one located here: "E:\Program Files\Microsoft Platform
SDK for Windows Server 2003 R2\Bin\win64\x86\AMD64\" - but that is not an
acceptable solution for me.
Regards,
Cristi Fati.
I've posted this question on the VC++ general forum but someone instructed
me to post it here.
I have a cpp program that uses ntddk.h(located in
$(DDK_INSTALL_DIR)\inc\ddk\wnet) - the ddk version is 3790.1830. I am trying
to compile it using MsVStudio2005(via project or Makefile). It works for
target machine X86 and IA64, but when i try to compile it for AMD64, i get
this error:
E:\WINDDK\3790.1830\inc\ddk\wnet\ntddk.h(10139) : error C4430: missing type
specifier - int assumed. Note: C++ does not support default-int
the compiler command is(and the vcvars are set to x86_amd64):
cl /nologo /GS /DWIN32 /D_WIN32 /W3 /D_WINNT /EHsc /c /DZLIB_WINAPI /DNDEBUG
/D_MBCS /MT /D_MT /X /TP /Wp64 /D_AMD64_=1 /DWIN64 /D_WIN64 /I "E:\Program
Files\Microsoft Visual Studio 8\VC\include" /I "E:\Program Files\Microsoft
Platform SDK for Windows Server 2003 R2"\Include /I "E:\Program
Files\Microsoft Platform SDK for Windows Server 2003 R2"\Include\crt /I
.\zlib\include /I E:\WINDDK\3790.1830\inc\ddk\wnet /I
E:\WINDDK\3790.1830\inc\wnet .\Process.cpp /Fo".\int_x64\Process.obj"
Process.cpp
Indeed when i took a look in ntddk.h file i found this:
The following piece of code starts at line 10129:
#define ExInterlockedExchangeUlong(Target, Value, Lock) \
_ExInterlockedExchangeUlong(Target, Value)
__forceinline
//ULONG
_ExInterlockedExchangeUlong (
IN OUT PULONG Target,
IN ULONG Value
)
{
return (ULONG)InterlockedExchange((PLONG)Target, (LONG)Value);
}
It's clear that the return type is missing(I added the "//ULONG" line there
and if i decomment that, it compiles fine on AMD64).
Is this a known issue? Is simply adding the return type a workaround that Ms
encourages?
Note: There's another workaround, using another compiler(well with slightly
different flags) - the one located here: "E:\Program Files\Microsoft Platform
SDK for Windows Server 2003 R2\Bin\win64\x86\AMD64\" - but that is not an
acceptable solution for me.
Regards,
Cristi Fati.