This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: g++ and sockets



This list is for development of gcc.
It is not a place to learn C/C++

Please send questions of this nature to comp.lang.c++.moderated, or some
  similar forum. 

On Fri, 12 May 2000, Neil Curran wrote:

> Hi,
> I am trying to use the socket.h file in c++ code using g++. Code that 
> compiles and runs as c code will generate errors as c++ code like:
> 
> stest1.cpp: In function `int main()':
> stest1.cpp:21:w arning: implicit declaration of function `int bzero(...)'
> stest1.cpp:39: warning: implicit declaration of function `int 
> inet_ntoa(...)'
> stest1.cpp:40: warning: implicit declaration of function `int fork(...)'
> stest1.cpp:43:w arning: implicit declaration of function `int close(...)'
> 
> Could anyone help me get around this?, I am using Solaris 2.6 and gcc 2.8.1
> 
[snip]

Probably, you just need to #include the header files that declare these
  functions. On most unices, 'man fork' will till you what header file
  fork() is declared in.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]