i cannot compile the c files in the terminal please help

Asked by konig

iam new in Linux system
i have c file i want to compile it in the terminal so
i typed gcc mico.c -o mico
i get this message
mico.c:21:19: error: stdio.h: No such file or directory
mico.c:22:20: error: stdlib.h: No such file or directory
mico.c:23:20: error: string.h: No such file or directory
mico.c:24:20: error: unistd.h: No such file or directory
mico.c:25:19: error: netdb.h: No such file or directory
mico.c:144: error: expected declaration specifiers or ‘...’ before ‘u_char’
mico.c:145: error: expected ‘)’ before ‘*’ token
mico.c:146: error: expected ‘)’ before ‘*’ token
mico.c: In function ‘shell’:
mico.c:153: error: ‘fd_set’ undeclared (first use in this function)
mico.c:153: error: (Each undeclared identifier is reported only once
mico.c:153: error: for each function it appears in.)
mico.c:153: error: expected ‘;’ before ‘rfds’
mico.c:156: error: ‘rfds’ undeclared (first use in this function)
mico.c:158: error: ‘NULL’ undeclared (first use in this function)
mico.c:162: warning: incompatible implicit declaration of built-in function ‘printf’
mico.c:163: warning: incompatible implicit declaration of built-in function ‘exit’
mico.c:163: error: ‘EXIT_FAILURE’ undeclared (first use in this function)
mico.c:170: warning: incompatible implicit declaration of built-in function ‘printf’
mico.c:171: warning: incompatible implicit declaration of built-in function ‘exit’
mico.c:173: warning: incompatible implicit declaration of built-in function ‘printf’
mico.c:174: warning: incompatible implicit declaration of built-in function ‘exit’
mico.c: At top level:
mico.c:181: error: expected declaration specifiers or ‘...’ before ‘u_char’
mico.c: In function ‘sock_send’:
mico.c:184: error: ‘src’ undeclared (first use in this function)
mico.c: At top level:
mico.c:188: error: expected ‘)’ before ‘*’ token
mico.c:217: error: expected ‘)’ before ‘*’ token
mico.c: In function ‘main’:
mico.c:235: warning: incompatible implicit declaration of built-in function ‘printf’
mico.c:240: warning: incompatible implicit declaration of built-in function ‘fprintf’
mico.c:240: error: ‘stderr’ undeclared (first use in this function)
mico.c:241: warning: incompatible implicit declaration of built-in function ‘exit’
mico.c:241: error: ‘EXIT_SUCCESS’ undeclared (first use in this function)

plz help me with this proplem

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Nizar Kerkeni
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
Best Nizar Kerkeni (nizarus) said :
#1

you need to install the build-essential package

Revision history for this message
konig (coco-for-uu) said :
#2

thanks a lot nizar kerkeni i will install it

Revision history for this message
konig (coco-for-uu) said :
#3

Thanks Nizar Kerkeni, that solved my question.

Revision history for this message
konig (coco-for-uu) said :
#4

i installed the build-essential package from the cd
the i typed
micooo@micooo-desktop:~$ gcc mico.c -o mico
i get this
micooo@micooo-desktop:~$
then a new file is called mico add to the desktop
please help

Revision history for this message
konig (coco-for-uu) said :
#5

i installed the build-essential package from the cd
the i typed
micooo@micooo-desktop:~$ gcc mico.c -o mico
i get this
micooo@micooo-desktop:~$
then a new file is called mico add to the desktop
please help

Revision history for this message
konig (coco-for-uu) said :
#6

Thanks Nizar Kerkeni, that solved my question.