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);
}
Did you use the project wizard to create a console project?
In poide Project -> Project options ... -> Compiler -> Enable Microsoft extensions
Use -Ze option in pocc.exe commandline
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..
Take that #include<winnt.h> away
Hi juice,
You should also take care of imnth. It's not used in your souce code.