Pelles C forum

C language => Beginner questions => Topic started by: Nicky on May 22, 2014, 04:24:25 PM

Title: still the problem of "No target architecture"
Post by: Nicky on May 22, 2014, 04:24:25 PM
First, I creat a console
And then, I write the code below
#include<graphics.h>
void main()
{
initgraph(1000,1000);
line(100,100,300,300);
lineto(400,500);
linerel(200,200);
getch();
}



But, when I compile, it goes wrong with "PellesC\Include\Win\winnt.h(559): fatal error #1014: #error: "No target architecture".
"
I tried the "Enable Microsoft extensions" in the project opinion, but it didn't work.
Thanks in advance.
Title: Re: still the problem of "No target architecture"
Post by: DMac on May 22, 2014, 06:04:06 PM
Try putting the following at the top of your source.

Code: [Select]
#ifndef _M_IX86
#define _M_IX86
#endif
Title: Re: still the problem of "No target architecture"
Post by: Nicky on May 23, 2014, 02:18:23 AM
Try putting the following at the top of your source.

Code: [Select]
#ifndef _M_IX86
#define _M_IX86
#endif


I tried, but it didin't work. Thanks for your help.
Title: Re: still the problem of "No target architecture"
Post by: frankie on May 23, 2014, 10:16:23 AM
Try putting
Code: [Select]
#include <windows.h>
Title: Re: still the problem of "No target architecture"
Post by: Nicky on May 23, 2014, 04:15:02 PM
Try putting
Code: [Select]
#include <windows.h>


Thanks for your help.
But it didn't work.
Title: Re: still the problem of "No target architecture"
Post by: frankie on May 23, 2014, 05:41:21 PM
Thanks for your help.
But it didn't work.

The error is generated in winnt.h with a #pragma message.
This means that that file is included in some way. All related architecture definitions are genereted starting from windows.h.
From your snippet we can't do any inference about the problem.
You have two possibilities:

P.S. If you are trying to include old Borland graphics.h (16 bit version) it will not work because PellesC is a 32/64 bits compiler.
If you are trying to use WinBGI or alike it will not work because these are C++ libraries.