June 30, 2005

gcc error : “warning: implicit declaration of function”

When I compile using the ‘-Wall’ option I recieve this error for many of the functions I am using such as fork(). Is there a reason for this or is it nothing to worry about? Here is the exact I/O:

zeusfaber@der-dieb:~/code/spacket-cmdr$ gcc -g -O3 -Wall -o scmdrd spacket-cmdr-server.c
spacket-cmdr-server.c: In function `main’:
spacket-cmdr-server.c:66: warning: implicit declaration of function `fork’
spacket-cmdr-server.c:67: warning: implicit declaration of function `close’
spacket-cmdr-server.c:76: warning: implicit declaration of function `system’
spacket-cmdr-server.c:79: warning: implicit declaration of function `exit’
spacket-cmdr-server.c:96: warning: implicit declaration of function `inet_ntoa’
spacket-cmdr-server.c:96: warning: format argument is not a pointer (arg 3)

If you have any ideas please post!! Thanks.

7 Comments

  1. Joe Williams Jun 30, 2005 11:00 am

    fixed!!!

    i needed to add the following librarys:

    unistd.h
    stdlib.h
    arpa/inet.h

  2. Anonymous Jul 01, 2005 7:31 am

    Whatever. Riding bikes is for fags and five-year-olds, bro.

  3. Developers « Projects 2008 Aug 10, 2008 12:48 am
  4. C section « Projects 2008 Sep 12, 2008 9:15 pm
  5. Gaurav Sep 19, 2008 8:45 am

    what about the same warning in case of kernel modules (kernel space)?

  6. joe Sep 20, 2008 7:56 am

    I would imagine it would require the same libraries but I’m not a kernel hacking expert.

  7. Soren Yeadon Nov 28, 2008 1:27 pm

    My Name Soren Yeadon

Leave a Comment

(required)

(will not be published) (required)