NO

Author Topic: still the problem of "No target architecture"  (Read 4418 times)

Nicky

  • Guest
still the problem of "No target architecture"
« 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.

Offline DMac

  • Member
  • *
  • Posts: 272
Re: still the problem of "No target architecture"
« Reply #1 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
No one cares how much you know,
until they know how much you care.

Nicky

  • Guest
Re: still the problem of "No target architecture"
« Reply #2 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.

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2097
Re: still the problem of "No target architecture"
« Reply #3 on: May 23, 2014, 10:16:23 AM »
Try putting
Code: [Select]
#include <windows.h>
It is better to be hated for what you are than to be loved for what you are not. - Andre Gide

Nicky

  • Guest
Re: still the problem of "No target architecture"
« Reply #4 on: May 23, 2014, 04:15:02 PM »
Try putting
Code: [Select]
#include <windows.h>


Thanks for your help.
But it didn't work.

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2097
Re: still the problem of "No target architecture"
« Reply #5 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:
  • Provide us with a sample that we can check (post a minimal project with all files required to reproduce the problem)
  • Check your installation, removing PellesC and reinstalling as administrator, to be sure that all paths are defined and required files are present and accessible.

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.
« Last Edit: May 23, 2014, 06:36:58 PM by frankie »
It is better to be hated for what you are than to be loved for what you are not. - Andre Gide