NO

Author Topic: fatal error #1014: #error: "No Target Architecture"  (Read 3251 times)

logicguy76

  • Guest
fatal error #1014: #error: "No Target Architecture"
« on: March 25, 2020, 08:11:47 PM »
I am trying out Pelles C for the first time.  I am trying to compile a 32-bit Windows console-mode program.  This program calls a few Windows API functions.  I have the following line near the top of my file:

#include <windows.h>


When attempting to compile the program I get:
Building rdcards.obj.
C:\Program Files\PellesC\Include\Win\winnt.h(105): fatal error 1014: #error: "No Target Architecture".
*** Error code: 1***
Done.

That error message seems to be coming from these lines in winnt.h:
#if defined(_AMD64_) || defined(_X86_)
#define PROBE_ALIGNMENT(_s)  TYPE_ALIGNMENT(DWORD)
#elif !defined(RC_INVOKED)
#error "No Target Architecture"
#endif

I tried adding
#define _X86_
to my program but that just caused more errors, so that doesn't appear to be the correct fix.

This program compiles fine with MS Visual Studio 2017, TinyC and MinGW.

What am I missing?

Thanks,
Charles Bailey


Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2096
Re: fatal error #1014: #error: "No Target Architecture"
« Reply #1 on: March 25, 2020, 10:23:24 PM »
Welcome.
In project options select the compiler tab and select "Enable Microsoft extensions".
It is better to be hated for what you are than to be loved for what you are not. - Andre Gide

logicguy76

  • Guest
Re: fatal error #1014: #error: "No Target Architecture"
« Reply #2 on: March 26, 2020, 12:02:50 AM »
Ah!  That did it.  Thanks for the quick response.