NO

Author Topic: winnt.h(559): fatal error #1014: #error: "No target architecture".  (Read 61771 times)

twh_twh

  • Guest
system:win7 64bit ,pellse c for windows 64bit 7.0

#include<stdio.h>
#include<windows.h>
void HideCursor();
void GotoXy(int,int);
int main(void){
    system("cls");
    HideCursor();
    char ball = 0x23;
    int x=0,y=0,kx=2,ky=1;
  for(;;){
    GotoXy(x,y);
    printf("%c",ball);Sleep(50);
    GotoXy(x,y);
    printf("%c",0x20);
    x +=kx ;y += ky;
    if (y>23) ky=-1;
    if (x>77) kx=-2;//45度大概XY 2:1的比例
    if (y<1) ky=1;
    if (x<1) kx=2;
    }
}

void HideCursor(){
    CONSOLE_CURSOR_INFO cursor_info = {1,0};//后边的0代表光标不可见
     SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE),&cursor_info);
 }
void GotoXy(int x,int y){
    HANDLE hout;
    COORD coord;
    coord.X = x;
    coord.Y = y;
    hout = GetStdHandle(STD_OUTPUT_HANDLE);
    SetConsoleCursorPosition(hout,coord);
}


CommonTater

  • Guest
Re: winnt.h(559): fatal error #1014: #error: "No target architecture".
« Reply #1 on: May 28, 2012, 05:25:03 AM »
Yes, and?????

If it's about the error... look in the help file --yes, really, the help file-- and check out the writeup on "your first project"... In Pelles C you can't simply type up the source code, you have to create a project first....

Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 772
Re: winnt.h(559): fatal error #1014: #error: "No target architecture".
« Reply #2 on: May 28, 2012, 05:27:43 AM »
Well, if with a (console, that seems what he seems to try and create )project, he will still get the error message, unless  he enables the "Microsoft extensions" in the project options...  ;)

Ralf

CommonTater

  • Guest
Re: winnt.h(559): fatal error #1014: #error: "No target architecture".
« Reply #3 on: May 28, 2012, 05:36:09 AM »
Well, if with a (console, that seems what he seems to try and create )project, he will still get the error message, unless  he enables the "Microsoft extensions" in the project options...  ;)

Ralf

OOPS... forgot about that.  Thanks Ralf.

twh_twh

  • Guest
Re: winnt.h(559): fatal error #1014: #error: "No target architecture".
« Reply #4 on: May 28, 2012, 05:46:52 AM »
Ralf,Thank you,what's the Microsoft extensions?How do I want to do in pelles c?

Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 772
Re: winnt.h(559): fatal error #1014: #error: "No target architecture".
« Reply #5 on: May 28, 2012, 05:49:23 AM »
Ralf,Thank you,what's the Microsoft extensions?How do I want to do in pelles c?
Could you possibly be bothered to check the "project options" as well as the associated help file/topic in Pelle's C, as already pointed out to you?

Ralf

twh_twh

  • Guest
Re: winnt.h(559): fatal error #1014: #error: "No target architecture".
« Reply #6 on: May 28, 2012, 06:17:37 AM »
project options->compiler Enable microsoft exensions


Building aa.obj.
F:\学习\编程语言-C语言\作业\aaa\aa.c(5): warning #2203: Function 'main' can't be __fastcall, changed to __cdecl.
F:\学习\编程语言-C语言\作业\aaa\aa.c(6): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(6): error #2048: Undeclared identifier ' '.
F:\学习\编程语言-C语言\作业\aaa\aa.c(6): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(6): error #2001: Syntax error: expected ';' but found ' '.
F:\学习\编程语言-C语言\作业\aaa\aa.c(6): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(6): error #2001: Syntax error: expected ';' but found ' '.
F:\学习\编程语言-C语言\作业\aaa\aa.c(6): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(6): error #2001: Syntax error: expected ';' but found ' system'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(6): warning #2018: Undeclared function ' system'; assuming 'extern' returning 'int'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(7): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(7): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(7): error #2001: Syntax error: expected ';' but found ' '.
F:\学习\编程语言-C语言\作业\aaa\aa.c(7): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(7): error #2001: Syntax error: expected ';' but found ' '.
F:\学习\编程语言-C语言\作业\aaa\aa.c(7): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(7): error #2001: Syntax error: expected ';' but found ' HideCursor'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(7): warning #2018: Undeclared function ' HideCursor'; assuming 'extern' returning 'int'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(8): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(8): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(8): error #2001: Syntax error: expected ';' but found ' '.
F:\学习\编程语言-C语言\作业\aaa\aa.c(8): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(8): error #2001: Syntax error: expected ';' but found ' '.
F:\学习\编程语言-C语言\作业\aaa\aa.c(8): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(8): error #2001: Syntax error: expected ';' but found ' char'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(8): error #2048: Undeclared identifier ' char'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(8): error #2001: Syntax error: expected ';' but found 'ball'.
F:\?癨编程语言-C语言\作业\aaa\aa.c(8): error #2048: Undeclared identifier 'ball'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(9): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(9): error #2036: Invalid character: '\x3000'.
F:\学?癨编程语言-C语言\作业\aaa\aa.c(9): error #2001: Syntax error: expected ';' but found ' '.
F:\学习\编程语言-C语言\作业\aaa\aa.c(9): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(9): error #2001: Syntax error: expected ';' but found ' '.
F:\学习\编程语言-C语言\作业\aaa\aa.c(9): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(9): error #2001: Syntax error: expected ';' but found ' int'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(9): error #2048: Undeclared identifier ' int'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(9): error #2001: Syntax error: expected ';' but found 'x'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(9): error #2048: Undeclared identifier 'x'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(9): error #2048: Undeclared identifier 'y'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(9): error #2048: Undeclared identifier 'kx'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(9): error #2048: Undeclared identifier 'ky'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(10): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(10): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(10): error #2001: Syntax error: expected ';' but found ' for'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(10): warning #2018: Undeclared function ' for'; assuming 'extern' returning 'int'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(10): error #2039: Invalid expression.
F:\学习\编程语言-C语言\作业\aaa\aa.c(10): error #2001: Syntax error: expected ')' but found ';'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(10): error #2061: Invalid statement termination.
F:\学习\编程语言-C语言\作业\aaa\aa.c(11): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(11): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(11): error #2001: Syntax error: expected ';' but found ' '.
F:\学习\编程语言-C语言\作业\aaa\aa.c(11): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(11): error #2001: Syntax error: expected ';' but found ' '.
F:\学习\编程语言-C语言\作业\aaa\aa.c(11): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(11): error #2001: Syntax error: expected ';' but found ' GotoXy'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(11): warning #2018: Undeclared function ' GotoXy'; assuming 'extern' returning 'int'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(12): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(12): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(12): error #2001: Syntax error: expected ';' but found ' '.
F:\学习\编程语言-C语言\作业\aaa\aa.c(12): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(12): error #2001: Syntax error: expected ';' but found ' '.
F:\学习\编程语言-C语言\作业\aaa\aa.c(12): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(12): error #2001: Syntax error: expected ';' but found ' printf'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(12): warning #2018: Undeclared function ' printf'; assuming 'extern' returning 'int'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(13): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(13): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(13): error #2001: Syntax error: expected ';' but found ' '.
F:\学习\编程语言-C语言\作业\aaa\aa.c(13): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(13): error #2001: Syntax error: expected ';' but found ' '.
F:\学习\编程语言-C语言\作业\aaa\aa.c(13): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(13): error #2001: Syntax error: expected ';' but found ' GotoXy'.
F:\学习\编程语言-C?镅診作业\aaa\aa.c(14): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(14): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(14): error #2001: Syntax error: expected ';' but found ' '.
F:\学习\编程语言-C语言\作业\aaa\aa.c(14): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(14): error #2001: Syntax error: expected ';' but found ' '.
F:\学习\编程语言-C语言\作业\aaa\aa.c(14): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(14): error #2001: Syntax error: expected ';' but found ' printf'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(15): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(15): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(15): error #2001: Syntax error: expected ';' but found ' '.
F:\学习\编程语言-C语言\作业\aaa\aa.c(15): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(15): error #2001: Syntax error: expected ';' but found ' '.
F:\学习\编程语言-C语言\作业\aaa\aa.c(15): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(15): error #2001: Syntax error: expected ';' but found ' x'.
F:\学习\编程?镅?C语言\作业\aaa\aa.c(15): error #2048: Undeclared identifier ' x'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(16): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(16): error #2036: Invalid character: '\x3000'.
F:\学习\编程?镅?C语言\作业\aaa\aa.c(16): error #2001: Syntax error: expected ';' but found ' '.
F:\学习\编程语言-C语言\作业\aaa\aa.c(16): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(16): error #2001: Syntax error: expected ';' but found ' '.
F:\学习\编程语言-C语言\作业\aaa\aa.c(16): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(16): error #2001: Syntax error: expected ';' but found ' if'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(16): warning #2018: Undeclared function ' if'; assuming 'extern' returning 'int'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(16): error #2001: Syntax error: expected ';' but found 'ky'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(17): error #2036: Invalid character: '\x3000'.
F:\?癨编程语言-C语言\作业\aaa\aa.c(17): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(17): error #2001: Syntax error: expected ';' but found ' '.
F:\学习\编程语言-C语言\作业\aaa\aa.c(17): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(17): error #2001: Syntax error: expected ';' but found ' '.
F:\学习\编程语言-C语言\作业\aaa\aa.c(17): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(17): error #2001: Syntax error: expected ';' but found ' if'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(17): error #2001: Syntax error: expected ';' but found 'kx'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(18): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(18): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(18): error #2001: Syntax error: expected ';' but found ' '.
F:\学习\编程语言-C语言\作业\aaa\aa.c(18): error #2036: Invalid character: '\x3000'.
F:\学习\编程语言-C语言\作业\aaa\aa.c(18): error #2001: Syntax error: expected ';' but found ' '.
F:\学习\编程语言-C语言\作业\aaa\aa.c(18): fatal error #2210: More than 100 errors, please improve yourself.
If you are compiling a Windows program, make sure you use the /Ze option!
*** Error code: 1 ***
Done.

Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 772
Re: winnt.h(559): fatal error #1014: #error: "No target architecture".
« Reply #7 on: May 28, 2012, 06:29:04 AM »
The obvious language barrier here aside, you need to understand we need more information than just a page full of error message. Your program you posted initially, compiled as a console project with the Microsoft extensions enabled compiles and runs for just fine (ok, i fixed the HideCursor function to avoid the "deprecated definition warning" too)...

Code: [Select]
Building C:\Documents and Settings\Ralf\My Documents\Pelles C Projects\thw\output\thw.obj.
C:\Documents and Settings\Ralf\My Documents\Pelles C Projects\thw\thw.c(5): warning #2134: Source code specifies an infinite loop.
Done.
Ralf

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: winnt.h(559): fatal error #1014: #error: "No target architecture".
« Reply #8 on: May 28, 2012, 03:23:50 PM »
你好!
这是一个完整的项目。
研究它。寻找项目选项。
请提高你的英语。在这里,我们只说英语。
(attached there is a complete project. Please study it. Look in the project options. Please improve your english here we only speak english.)

Please DON'T answer in chinese. 谢谢 (thanks).

EDIT: New version below.
« Last Edit: May 28, 2012, 06:18:38 PM by frankie »
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

CommonTater

  • Guest
Re: winnt.h(559): fatal error #1014: #error: "No target architecture".
« Reply #9 on: May 28, 2012, 03:24:55 PM »
It looks to me like you are running into code page problems... First of all the character \x3000 would overflow a standard char variable... you will need to enable unicode to handle values in that range and unicode programming is definately not beginner stuff.  Second it appears that some of your keyboard mappings are different, again because of the code page issue.

Pelles C is pretty much an english programming language (like all implementations of C), which requires you to be working from an English Language code page when composing source code.  You can enter unicode characters into string variables and string literals, but you really do need to be working in English for the source code itself.

Next time this happens... go to Project -> Zip Project Files ... and post the project itself here for us to look at.  As far as I can tell none of us is blessed with mental telepathy...

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: winnt.h(559): fatal error #1014: #error: "No target architecture".
« Reply #10 on: May 28, 2012, 06:13:48 PM »
I have missed an important point: you have to set your source files as 'UTF-16LE', and must use IDE editor (don't edit them with an external editor that use an encoding unknown to the compiler). If your source is already written copy it and then past in a new IDE page.
I attach another version of the project with correct encoding.
The project is compiled for 32bits, simply change to 64bits from options if you like it so.

P.S. to set encoding of an IDE source file just right click everywhere on the editor window, choose properties than set encoding.
« Last Edit: May 28, 2012, 06:16:05 PM by frankie »
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

CommonTater

  • Guest
Re: winnt.h(559): fatal error #1014: #error: "No target architecture".
« Reply #11 on: May 28, 2012, 07:21:55 PM »
I think our friend is discovering one of the many reasons most programmers work in English.

@frankie... he should also be able to use UTF8 which should give him smaller source files.

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: winnt.h(559): fatal error #1014: #error: "No target architecture".
« Reply #12 on: May 28, 2012, 08:01:36 PM »
Well using an english derivate language it is easier, but how to put comments in your mother tongue?  ;D
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

CommonTater

  • Guest
Re: winnt.h(559): fatal error #1014: #error: "No target architecture".
« Reply #13 on: May 28, 2012, 08:33:54 PM »
Well using an english derivate language it is easier, but how to put comments in your mother tongue?  ;D

You want to write on your mother's tongue?  Ewwww.... :D

Point taken.

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: winnt.h(559): fatal error #1014: #error: "No target architecture".
« Reply #14 on: May 28, 2012, 09:23:07 PM »
Our friend put comments in chinese.....
45度大概XY 2:1的比例 -> 45 degrees is roughly 2:1 ratio
后边的0代表光标不可见 -> set to 0 to hide the cursor
 and maybe he want print something in chinese....
« Last Edit: May 28, 2012, 09:30:21 PM by frankie »
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide