Find the answer to your Linux question:
Results 1 to 2 of 2
I am trying to compile a .c file with gcc. I recently thought I had to move all the header files to /usr/includes/ but I guess that wasn't the case ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2006
    Posts
    22

    Compiling Error


    I am trying to compile a .c file with gcc. I recently thought I had to move all the header files to /usr/includes/ but I guess that wasn't the case because I got these errors.

    ./dl-cups.c:10:19: error: stdio.h: No such file or directory
    ./dl-cups.c:11:23: error: sys/types.h: No such file or directory
    ./dl-cups.c:12:24: error: sys/socket.h: No such file or directory
    ./dl-cups.c:13:24: error: netinet/in.h: No such file or directory
    ./dl-cups.c:14:19: error: netdb.h: No such file or directory
    ./dl-cups.c: In function ‘usage’:
    ./dl-cups.c:19: warning: incompatible implicit declaration of built-in function ‘fprintf’
    ./dl-cups.c:19: error: ‘stdout’ undeclared (first use in this function)
    ./dl-cups.c:19: error: (Each undeclared identifier is reported only once
    ./dl-cups.c:19: error: for each function it appears in.)
    ./dl-cups.c:22: warning: incompatible implicit declaration of built-in function ‘exit’
    ./dl-cups.c: In function ‘main’:
    ./dl-cups.c:28: error: storage size of ‘serv_addr’ isn’t known
    ./dl-cups.c:34: warning: incompatible implicit declaration of built-in function ‘printf’
    ./dl-cups.c:35: warning: incompatible implicit declaration of built-in function ‘snprintf’
    ./dl-cups.c:36: warning: incompatible implicit declaration of built-in function ‘strcat’
    ./dl-cups.c:39: error: ‘AF_INET’ undeclared (first use in this function)
    ./dl-cups.c:39: error: ‘SOCK_STREAM’ undeclared (first use in this function)
    ./dl-cups.c:42: warning: assignment makes pointer from integer without a cast
    ./dl-cups.c:43: error: ‘NULL’ undeclared (first use in this function)
    ./dl-cups.c:50: warning: incompatible implicit declaration of built-in function ‘bcopy’
    ./dl-cups.c:50: error: dereferencing pointer to incomplete type
    ./dl-cups.c:50: error: dereferencing pointer to incomplete type
    ./dl-cups.c:56: warning: incompatible implicit declaration of built-in function ‘strlen’

  2. #2
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    hi Fix3r !!

    post declaration part of the code.





    casper
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •