NO

Author Topic: error: "No target architecture"  (Read 3883 times)

juice

  • Guest
error: "No target architecture"
« on: June 19, 2012, 07:26:07 PM »
Why does the following code produce error under pelles C?? It works fine with MSVC 2010..

Code: [Select]
#include<winnt.h>
#include<windows.h>
#include<stdlib.h>
#include<stdio.h>

int main()
{
FILE *fp;
IMAGE_DOS_HEADER imdh;
IMAGE_NT_HEADERS imnth;

if((fp = fopen("c:\\le.exe","r"))==NULL)
{
printf("Unable to open file\n");
exit(0);
}

fread(&imdh,sizeof(imdh),1,fp);
fseek(fp,imdh.e_lfanew,SEEK_SET);
}
 
« Last Edit: June 19, 2012, 08:09:05 PM by juice »

Offline Vortex

  • Member
  • *
  • Posts: 803
    • http://www.vortex.masmcode.com
Re: error: "No target architecture"
« Reply #1 on: June 19, 2012, 08:17:17 PM »
Did you use the project wizard to create a console project?
Code it... That's all...

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2091
Re: error: "No target architecture"
« Reply #2 on: June 19, 2012, 08:23:53 PM »
In poide Project -> Project options ... -> Compiler -> Enable Microsoft extensions
Use -Ze option in pocc.exe commandline
May the source be with you

juice

  • Guest
Re: error: "No target architecture"
« Reply #3 on: June 19, 2012, 08:34:25 PM »
In poide Project -> Project options ... -> Compiler -> Enable Microsoft extensions
Use -Ze option in pocc.exe commandline

I enabled Microsoft extensions and the count of errrors exceeded 100..

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2091
Re: error: "No target architecture"
« Reply #4 on: June 19, 2012, 08:43:54 PM »
Take that #include<winnt.h> away
May the source be with you

Offline Vortex

  • Member
  • *
  • Posts: 803
    • http://www.vortex.masmcode.com
Re: error: "No target architecture"
« Reply #5 on: June 19, 2012, 08:47:25 PM »
Hi juice,

You should also take care of imnth. It's not used in your souce code.
Code it... That's all...