error: "No target architecture"

Started by juice, June 19, 2012, 07:26:07 PM

Previous topic - Next topic

juice

Why does the following code produce error under pelles C?? It works fine with MSVC 2010..

#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);
}

Vortex

Did you use the project wizard to create a console project?
Code it... That's all...

TimoVJL

In poide Project -> Project options ... -> Compiler -> Enable Microsoft extensions
Use -Ze option in pocc.exe commandline
May the source be with you

juice

Quote from: timovjl on June 19, 2012, 08:23:53 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..

TimoVJL

May the source be with you

Vortex

Hi juice,

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