home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / gnu / gcc / help / 2541 < prev    next >
Encoding:
Text File  |  1992-11-17  |  1.1 KB  |  49 lines

  1. Newsgroups: gnu.gcc.help
  2. Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!sun2.cern.CH!cane
  3. From: cane@sun2.cern.CH (Fabrizio Cane)
  4. Subject: C++ and C
  5. Message-ID: <9211171107.AA00444@sun2.cern.ch>
  6. Sender: daemon@cis.ohio-state.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Tue, 17 Nov 1992 13:07:02 GMT
  10. Lines: 37
  11.  
  12.  
  13. hi
  14.  
  15. I have a problem when I try to interface the gnu C++ to
  16. the standard C functions. I want to use for example a C
  17. routine ( let be socket() ) in a C++ program.
  18.  
  19. main(int argc, char* argv[])
  20. {
  21. ...
  22.     socket(parameters);
  23. ...
  24. }
  25.  
  26. At compile time I have the following warning:
  27.  
  28. main.C: In function `int  main (int, char **)':
  29. main.C: warning: implicit declaration of function `socket()'
  30.  
  31. The program works bu I would like to remove these 
  32. warnings and apparently I cant do it using
  33.  
  34. extern int socket()
  35. or
  36. extern int socket(...)
  37. or 
  38. extern int socket('parameter declaration')
  39.  
  40. because in this case the linker does not find the
  41. expected C++ object of socket() that is named 
  42. socket_??_???_ because of the parameter check !
  43.  
  44. Any idea about that ?
  45.  
  46. Thank you
  47. Fab
  48.  
  49.