Pelles C forum

Pelles C => General discussions => Topic started by: logicguy76 on March 25, 2020, 08:11:47 pm

Title: fatal error #1014: #error: "No Target Architecture"
Post by: logicguy76 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

Title: Re: fatal error #1014: #error: "No Target Architecture"
Post by: frankie on March 25, 2020, 10:23:24 pm
Welcome.
In project options select the compiler tab and select "Enable Microsoft extensions".
Title: Re: fatal error #1014: #error: "No Target Architecture"
Post by: logicguy76 on March 26, 2020, 12:02:50 am
Ah!  That did it.  Thanks for the quick response.