🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Fabrizio Cane Tue, 17 Nov 1992 13:07
C++ and C
#653
Author: Fabrizio Cane
Date: Tue, 17 Nov 1992 13:07
36 lines
1151 bytes
hi

I have a problem when I try to interface the gnu C++ to
the standard C functions. I want to use for example a C
routine ( let be socket() ) in a C++ program.

main(int argc, char* argv[])
{
...
    socket(parameters);
...
}

At compile time I have the following warning:

main.C: In function `int  main (int, char **)':
main.C: warning: implicit declaration of function `socket()'

The program works bu I would like to remove these 
warnings and apparently I cant do it using

extern int socket()
or
extern int socket(...)
or 
extern int socket('parameter declaration')

because in this case the linker does not find the
expected C++ object of socket() that is named 
socket_??_???_ because of the parameter check !

Any idea about that ?

Thank you
Fab
Re: C++ and C
#663
Author: Ab Wilson
Date: Wed, 18 Nov 1992 13:50
11 lines
782 bytes
Try

extern "C" int sockect(<parameters>);

and RTFM,
	Ab.
-- 
+--------------------------------------------------------------------+
| Who's opinions did you say these were?    |    naw@planet.bt.co.uk |
+--------------------------------------------------------------------+
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads