Pelles C forum

C language => Beginner questions => Topic started by: tumanovalex on November 10, 2011, 10:00:53 AM

Title: Error "No target architecture"
Post by: tumanovalex on November 10, 2011, 10:00:53 AM
In program
Code: [Select]
#include <locale.h>
#include <stdio.h>
#include <string.h>
#include <conio.h>
#include <windows.h>

int main(int argc, char *argv[])
{
  setlocale(LC_ALL, "");
  char sDisk[] = "C:";
  DWORD nByteRead = 0, nSectorPerCluster = 0, nBytesPerSector = 0, nFreeClusters = 0, nClustersForUser = 0;
  if(GetDiskFreeSpace((LPCTSTR)sDisk, &nSectorPerCluster, &nBytesPerSector, &nFreeClusters, &nClustersForUser)==0)
    {
      printf("\nCan't find disk %s!\n", sDisk);
      _getch();
      exit(1);
    }
  printf("\nSectorPerCluster - %Li\nnBytesPerSector - %Li\nFreeClusters - %Li\nClustersForUser - %Li\n\n",
             nSectorPerCluster, nBytesPerSector, nFreeClusters, nClustersForUser);
  return 0;
}
error:
Building main.obj.
C:\Program Files\PellesC\Include\Win\winnt.h(558): fatal error #1014: #error: "No target architecture". *** Error code: 1 ***
Help me, please!
Title: Re: Error "No target architecture"
Post by: Stefan Pendl on November 10, 2011, 11:01:33 AM
How did you set up your project?
Title: Re: Error "No target architecture"
Post by: iZzz32 on November 10, 2011, 01:15:17 PM
tumanovalex, check Compiler->Enable Microsoft extensions in Project options or use -Ze flag if you're compiling from the command line.
Title: Re: Error "No target architecture"
Post by: tumanovalex on November 12, 2011, 09:41:14 AM
Thanks big! Henceforth I will try to be more attentive!