Solved

warning message in C

Posted on 2008-10-17
2
279 Views
Last Modified: 2012-05-05
Hello group,

GCC complains (warning) on following line with this message:   test.c:81: warning: implicit declaration of function 'close'

     main()

    {

        ..... some code

        close(sock);  //closing a socket

        return 0;
      }


what is wrong here?

Thanks.

0
Comment
Question by:akohan
2 Comments
 
LVL 23

Accepted Solution

by:
Kamaraj Subramanian earned 125 total points
ID: 22746226
you need these files

unistd.h
stdlib.h
arpa/inet.h
0
 

Author Comment

by:akohan
ID: 22746381


Thanks!

Right, I was missing unistd.h so now it is included.

Regards,
ak
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now