none
Using wrong windef.h file - C1189: #error : Must define a target architecture

    Question

  • I have a Microsoft Visual Studio project that I'm compiling for Windows Mobile 5.0 Pocket PC SDK (ARMV4I).  It compiles fine on my laptop but returns error C1189 when I try to compile on my desktop.  Looking at the build output the desktop VS is using "C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\windef.h" and the laptop VS is using "C:\Program Files\Windows Mobile 5.0 SDK R2\PocketPC\include\ARMV4I\windef.h".  I don't know why they're using different input files.
    I've tried copying the files over from my laptop to my desktop.  Still get the error.
    I've tried resetting all the environment settings.  Still get the error.
    I've tried reinstalling VS on my desktop, following the method on http://msdn.microsoft.com/en-us/library/ms246604(v=VS.90).aspx.  Still get the 
    error.
    I'll include the output from the desktop then the laptop below.
    DESKTOP%%%%%%%%%%%%%%%%%
    1>------ Rebuild All started: Project: numrecipes, Configuration: Debug Windows Mobile 5.0 Pocket PC SDK (ARMV4I) ------
    1>Deleting intermediate and output files for project 'numrecipes', configuration 'Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)'
    1>Compiling...
    1>gaussj.cpp
    1>Note: including file: c:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include\cmath
    1>Note: including file:  c:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include\yvals.h
    1>Note: including file:   c:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include\crtdefs.h
    1>Note: including file:    c:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include\sal.h
    1>Note: including file:     c:\program files\microsoft visual studio 9.0\vc\ce\include\codeanalysis\sourceannotations.h
    1>Note: including file:   c:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include\altcecrt.h
    1>Note: including file:    C:\Program Files\Windows Mobile 5.0 SDK R2\PocketPC\include\ARMV4I\tchar.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\windef.h
    1>Note: including file:      C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnt.h
    1>Note: including file:       C:\Program Files\Windows Mobile 5.0 SDK R2\PocketPC\include\ARMV4I\ctype.h
    1>Note: including file:        c:\program files\windows mobile 5.0 sdk r2\pocketpc\include\armv4i\stdlib.h
    1>Note: including file:         C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\specstrings.h
    1>Note: including file:          C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\specstrings_adt.h
    1>Note: including file:          C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\specstrings_strict.h
    1>Note: including file:           C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\specstrings_undef.h
    1>Note: including file:       C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\basetsd.h
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnt.h(734) : fatal error C1189: #error :  Must define a target architecture.
    1>pythag.cpp
    1>Note: including file: c:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include\cmath
    1>Note: including file:  c:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include\yvals.h
    1>Note: including file:   c:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include\crtdefs.h
    1>Note: including file:    c:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include\sal.h
    1>Note: including file:     c:\program files\microsoft visual studio 9.0\vc\ce\include\codeanalysis\sourceannotations.h
    1>Note: including file:   c:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include\altcecrt.h
    1>Note: including file:    C:\Program Files\Windows Mobile 5.0 SDK R2\PocketPC\include\ARMV4I\tchar.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\windef.h
    1>Note: including file:      C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnt.h
    1>Note: including file:       C:\Program Files\Windows Mobile 5.0 SDK R2\PocketPC\include\ARMV4I\ctype.h
    1>Note: including file:        c:\program files\windows mobile 5.0 sdk r2\pocketpc\include\armv4i\stdlib.h
    1>Note: including file:         C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\specstrings.h
    1>Note: including file:          C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\specstrings_adt.h
    1>Note: including file:          C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\specstrings_strict.h
    1>Note: including file:           C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\specstrings_undef.h
    1>Note: including file:       C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\basetsd.h
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnt.h(734) : fatal error C1189: #error :  Must define a target architecture.
    1>svdcmp.cpp
    1>Note: including file: c:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include\cmath
    1>Note: including file:  c:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include\yvals.h
    1>Note: including file:   c:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include\crtdefs.h
    1>Note: including file:    c:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include\sal.h
    1>Note: including file:     c:\program files\microsoft visual studio 9.0\vc\ce\include\codeanalysis\sourceannotations.h
    1>Note: including file:   c:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include\altcecrt.h
    1>Note: including file:    C:\Program Files\Windows Mobile 5.0 SDK R2\PocketPC\include\ARMV4I\tchar.h
    1>Note: including file:     C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\windef.h
    1>Note: including file:      C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnt.h
    1>Note: including file:       C:\Program Files\Windows Mobile 5.0 SDK R2\PocketPC\include\ARMV4I\ctype.h
    1>Note: including file:        c:\program files\windows mobile 5.0 sdk r2\pocketpc\include\armv4i\stdlib.h
    1>Note: including file:         C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\specstrings.h
    1>Note: including file:          C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\specstrings_adt.h
    1>Note: including file:          C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\specstrings_strict.h
    1>Note: including file:           C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\specstrings_undef.h
    1>Note: including file:       C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\basetsd.h
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnt.h(734) : fatal error C1189: #error :  Must define a target architecture.
    1>eigsrt.cpp
    1>Note: including file: c:\documents and settings\sgraybill\my documents\visual studio 2008\projects\components and libraries\numrecipes\nr.h
    1>Note: including file:  c:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include\fstream
    1>Note: including file:   c:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include\istream
    1>Note: including file:    c:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include\ostream
    1>Note: including file:     c:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include\ios
    1>Note: including file:      c:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include\yvals.h
    1>Note: including file:       c:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include\crtdefs.h
    1>Note: including file:        c:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include\sal.h
    1>Note: including file:         c:\program files\microsoft visual studio 9.0\vc\ce\include\codeanalysis\sourceannotations.h
    1>Note: including file:       c:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include\altcecrt.h
    1>Note: including file:        C:\Program Files\Windows Mobile 5.0 SDK R2\PocketPC\include\ARMV4I\tchar.h
    1>Note: including file:         C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\windef.h
    1>Note: including file:          C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnt.h
    1>Note: including file:           C:\Program Files\Windows Mobile 5.0 SDK R2\PocketPC\include\ARMV4I\ctype.h
    1>Note: including file:            c:\program files\windows mobile 5.0 sdk r2\pocketpc\include\armv4i\stdlib.h
    1>Note: including file:             C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\specstrings.h
    1>Note: including file:              C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\specstrings_adt.h
    1>Note: including file:              C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\specstrings_strict.h
    1>Note: including file:               C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\specstrings_undef.h
    1>Note: including file:           C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\basetsd.h
    1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\winnt.h(734) : fatal error C1189: #error :  Must define a target architecture.
    1>Generating Code...
    1>Build log was saved at "file://c:\Documents and Settings\sgraybill\My Documents\Visual Studio 2008\Projects\Components and 
    Libraries\numrecipes\Windows Mobile 5.0 Pocket PC SDK (ARMV4I)\Debug\BuildLog.htm"
    1>numrecipes - 4 error(s), 0 warning(s)
    ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
    LAPTOP%%%%%%%%%%%%%%%%%
    1>------ Rebuild All started: Project: numrecipes, Configuration: Debug Windows Mobile 5.0 Pocket PC SDK (ARMV4I) ------
    1>Deleting intermediate and output files for project 'numrecipes', configuration 'Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)'
    1>Compiling...
    1>gaussj.cpp
    1>Note: including file: c:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include\cmath
    1>Note: including file:  c:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include\yvals.h
    1>Note: including file:   c:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include\crtdefs.h
    1>Note: including file:    c:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include\sal.h
    1>Note: including file:     c:\program files\microsoft visual studio 9.0\vc\ce\include\codeanalysis\sourceannotations.h
    1>Note: including file:   c:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include\altcecrt.h
    1>Note: including file:    C:\Program Files\Windows Mobile 5.0 SDK R2\PocketPC\include\ARMV4I\tchar.h
    1>Note: including file:     C:\Program Files\Windows Mobile 5.0 SDK R2\PocketPC\include\ARMV4I\windef.h
    1>Note: including file:      C:\Program Files\Windows Mobile 5.0 SDK R2\PocketPC\include\ARMV4I\winnt.h
    1>Note: including file:       C:\Program Files\Windows Mobile 5.0 SDK R2\PocketPC\include\ARMV4I\ctype.h
    1>Note: including file:        c:\program files\windows mobile 5.0 sdk r2\pocketpc\include\armv4i\stdlib.h
    1>Note: including file:         C:\Program Files\Windows Mobile 5.0 SDK R2\PocketPC\include\ARMV4I\specstrings.h
    1>Note: including file:       C:\Program Files\Windows Mobile 5.0 SDK R2\PocketPC\include\ARMV4I\basetsd.h
    1>Note: including file:       C:\Program Files\Windows Mobile 5.0 SDK R2\PocketPC\include\ARMV4I\ntstatus.h
    1>Note: including file:       C:\Program Files\Windows Mobile 5.0 SDK R2\PocketPC\include\ARMV4I\pshpack4.h
    1>Note: including file:       C:\Program Files\Windows Mobile 5.0 SDK R2\PocketPC\include\ARMV4I\poppack.h
    1>Note: including file:       c:\program files\windows mobile 5.0 sdk r2\pocketpc\include\armv4i\pshpack4.h
    1>Note: including file:       c:\program files\windows mobile 5.0 sdk r2\pocketpc\include\armv4i\pshpack2.h
    1>Note: including file:       c:\program files\windows mobile 5.0 sdk r2\pocketpc\include\armv4i\poppack.h
    1>Note: including file:       c:\program files\windows mobile 5.0 sdk r2\pocketpc\include\armv4i\pshpack2.h
    1>Note: including file:       c:\program files\windows mobile 5.0 sdk r2\pocketpc\include\armv4i\poppack.h
    1>Note: including file:       c:\program files\windows mobile 5.0 sdk r2\pocketpc\include\armv4i\pshpack8.h
    1>Note: including file:       c:\program files\windows mobile 5.0 sdk r2\pocketpc\include\armv4i\poppack.h
    1>Note: including file:       c:\program files\windows mobile 5.0 sdk r2\pocketpc\include\armv4i\poppack.h
    1>Note: including file:       C:\Program Files\Windows Mobile 5.0 SDK R2\PocketPC\include\ARMV4I\string.h
    1>Note: including file:        c:\program files\windows mobile 5.0 sdk r2\pocketpc\include\armv4i\stdlib.h
    1>Note: including file:     C:\Program Files\Windows Mobile 5.0 SDK R2\PocketPC\include\ARMV4I\stdlib.h
    1>Note: including file:    C:\Program Files\Windows Mobile 5.0 SDK R2\PocketPC\include\ARMV4I\time.h
    1>Note: including file:    c:\Program Files\Microsoft Visual Studio 9.0\VC\ce\include\crtdefs.h
    1>Note: including file:    C:\Program Files\Windows Mobile 5.0 SDK R2\PocketPC\include\ARMV4I\kfuncs.h
    1>Note: including file:   C:\Program Files\Windows Mobile 5.0 SDK R2\PocketPC\include\ARMV4I\use_ansi.h
    1>Note: including file:   C:\Program Files\Windows Mobile 5.0 SDK R2\PocketPC\include\ARMV4I\stdlib.h
    1>Note: including file:   C:\Program Files\Windows Mobile 5.0 SDK R2\PocketPC\include\ARMV4I\ctype.h
    1>Note: including file:    c:\program files\windows mobile 5.0 sdk r2\pocketpc\include\armv4i\stdlib.h
    1>Note: including file:  C:\Program Files\Windows Mobile 5.0 SDK R2\PocketPC\include\ARMV4I\math.h
    1>Note: including file:   c:\program files\windows mobile 5.0 sdk r2\pocketpc\include\armv4i\stdlib.h
    ...
    1>Generating Code...
    1>Creating library...
    1>Build log was saved at "file://c:\Documents and Settings\sgraybill\My Documents\Visual Studio 2008\Projects\Components and 
    Libraries\numrecipes\Windows Mobile 5.0 Pocket PC SDK (ARMV4I)\Debug\BuildLog.htm"
    1>numrecipes - 0 error(s), 20 warning(s)
    ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
    Monday, June 06, 2011 10:56 PM

Answers

  • You have regular windows headers mixed in with your Windows Mobile headers. In Visual Studio 2008, under tools->options select Projects and Solutions->VC++ Directories. Select your platform and select Include Directories.

    Remove C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include from that list. (It may be defined with a  macro and look like this instead $(VCInstallDir)include)

    Now, try your recompile.

    -PaulH

    • Marked as answer by sgrayb Tuesday, June 07, 2011 10:40 PM
    Tuesday, June 07, 2011 1:57 PM

All replies

  • You have regular windows headers mixed in with your Windows Mobile headers. In Visual Studio 2008, under tools->options select Projects and Solutions->VC++ Directories. Select your platform and select Include Directories.

    Remove C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include from that list. (It may be defined with a  macro and look like this instead $(VCInstallDir)include)

    Now, try your recompile.

    -PaulH

    • Marked as answer by sgrayb Tuesday, June 07, 2011 10:40 PM
    Tuesday, June 07, 2011 1:57 PM
  • Thank you very much for your correct and easy to follow solution.  I have spent an incredible amount of time on this trivially fixed problem.

    I have no idea how those lines got in there.

    Tuesday, June 07, 2011 10:43 PM