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


  • 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***

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

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?

Charles Bailey

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 1928
Re: fatal error #1014: #error: "No Target Architecture"
« Reply #1 on: March 25, 2020, 10:23:24 pm »
In project options select the compiler tab and select "Enable Microsoft extensions".


  • 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.