LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   gcc compilation problem (https://www.linuxquestions.org/questions/ubuntu-63/gcc-compilation-problem-664810/)

jestinjoy 08-23-2008 09:22 AM

gcc compilation problem
 
when i tried to compile this program using gcc in kubuntu 8.04 I got this error message..........Plz help.

PROGRAM


#include<sys/types.h>
#include<fcntl.h>
#include<sys/stat.h>
int main(int argc,char *argv[])
{
int fdold,fdnew,count;
char buffer[100];
fdold=open(argv[1],O-RDONLY);
fdnew=creat(argv[2],0777);
do{
count=read(fdold,buffer,1);
write(fdnew,buffer,1);
}
while(count!=0);
}

ERROR


copy.c:1:22: error: sys/types.h: No such file or directory
copy.c:2:18: error: fcntl.h: No such file or directory
copy.c:3:21: error: sys/stat.h: No such file or directory
copy.c: In function âmainâ:
copy.c:8: error: âOâ undeclared (first use in this function)
copy.c:8: error: (Each undeclared identifier is reported only once
copy.c:8: error: for each function it appears in.)
copy.c:8: error: âRDONLYâ undeclared (first use in this function)

knudfl 08-23-2008 11:08 AM

Quote:

copy.c:1:22: error: sys/types.h: No such file or directory
copy.c:2:18: error: fcntl.h: No such file or directory
copy.c:3:21: error: sys/stat.h: No such file or directory
Very simple, you have no 'glibc-devel'
'apt-get libc6-dev' will do.

Good Luck.

Micro420 08-23-2008 12:12 PM

I recommend installing the build-essentials package which will give you a lot of the developing tools needed.


All times are GMT -5. The time now is 04:12 PM.