Hello, I'm using PellesC 6.0 and want to compile some codes with many traditional unix-style c functions. I can see the .h files in the dir 'include', such as io.h / fcntl.h ... but when I build the project, the ide always show me warnings and errors regarding 'missing prototype for those functions' or 'undeclared identifier'. Here is the simple test code:
#include <io.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
char *filename="mytext.txt";
char *text="Hello, world!\n";
int main()
{
int i;
i=open(filename,O_CREAT|O_RDWR);
if(i==-1){
printf("error to open the file!\n");
return -1;
}
if(write(i,text,strlen(text))==-1){
printf("fail to write!\n");
close(i);
return -1;
}
else{
printf("success to write!\n");
close(i);
return 0;
}
}