1
votes

i am using Visual studio 2005 with WDK 7600.16385.1.i am compiling User mode Printer driver it will successfully build when i select "Win32" for platform but when i build this driver for "x64" i get compiler Error tha is given below

C:\WinDDK\7600.16385.1\inc\api\winnt.h(135) : fatal error C1189: #error : "No Target Architecture"

i have checked winnt.h and code is given below

    #if defined(_WIN64)

#if defined(_AMD64_)
#define PROBE_ALIGNMENT( _s ) TYPE_ALIGNMENT( DWORD )
#elif defined(_IA64_)
#define PROBE_ALIGNMENT( _s ) (TYPE_ALIGNMENT( _s ) > TYPE_ALIGNMENT( DWORD ) ? \
                              TYPE_ALIGNMENT( _s ) : TYPE_ALIGNMENT( DWORD ))
#else
#error "No Target Architecture"
#endif

#define PROBE_ALIGNMENT32( _s ) TYPE_ALIGNMENT( DWORD )

#else

and C/C++ command line switches is given below (copied from project "property->C/C++->Command Line")

/Od /Oi /I "..\inc" /I "C:\WinDDK\WXP\inc\wxp" /I "C:\WinDDK\WXP\inc\crt" /I "C:\WinDDK\WXP\inc" /D "_X86_=1" /D "i386=1" /D "STD_CALL" /D "CONDITION_HANDLING=1" /D "WIN32_LEAN_AND_MEAN=1" /D "NT_UP=1" /D "NT_INST=0" /D "WIN32=100" /D "_NT1X_=100" /D "_WIN32_WINNT=0X0500" /D "WINNT" /D "DEVL=1" /D "FPO=0" /D "UNICODE" /D "_IDWBUILD" /D "USERMODE_DRIVER" /D "DBG=1" /D "DEBUG" /D "RDRDBG" /D "SRVDBG" /GF /FD /MTd /Zp8 /GS- /Gy /Fo".\Debug/" /Fd"x64\Debug\vc80.pdb" /W1 /nologo /c /Z7 /Gz /TP /FI "..\inc\warning.h" /errorReport:prompt

Please help me as soon as possible

2
i have passted the macro befor error "No Target Architecture" and find X86 and _M_AMD64 is definded ,i coppied macro form i.e given by gexaman from URL social.msdn.microsoft.com/forums/en-US/vcgeneral/thread/…Abdul jalil
for more i replace x86 with AMD64 and got error "Error result 1 returned from 'C:\Program Files\Microsoft Visual Studio 8\VC\bin\x86_amd64\cl.exe'."Abdul jalil
when i define both X86 and AMD64 i get "error C2011: '_CONTEXT' : 'struct' type redefinition C:\WinDDK\7600.16385.1\inc\api\winnt."Abdul jalil
you can just edit your question, no need to add comments.Steve-o

2 Answers

1
votes

My best guess would be to define _AMD_64_ in the project properties (assuming you're using x64 and not ia64)

0
votes

Why are you trying to build this from within Visual Studio? Using the WDK and the standard build procedure (i.e. sources/makefile and build).

-scott