By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,120 Members | 1,257 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,120 IT Pros & Developers. It's quick & easy.

Proting C source to C++ ?

P: n/a
I have an old program writed in C language,
This program simply use some general system
call like "select","read","write" etc, to
do network communication. The problem is that
when I change it to C++ fomat and use g++ 2.7.2
with g++lib 2.7.1 in SunOS 4.1.3 to compile the
program, some protype warning error occur.

How to using the old C standard library and system call
in a C++ program, how to include the protype of them?

I list some part of my program had occured error as follows:
server.C:42: aggregate `struct sockaddr_in fsin' has incomplete type and
cannot be initialized
server.C:52: warning: implicit declaration of function `int bzero(...)'
server.C:54: warning: implicit declaration of function `int getdtablesize
(...)'
server.C:56: warning: implicit declaration of function `int bcopy(...)'
server.C:57: warning: implicit declaration of function `int select(...)'
server.C:64: warning: implicit declaration of function `int accept(...)'

Thanks if anyone can solve the problem!!!!
Jul 28 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Melquíades wrote:
I have an old program writed in C language,
This program simply use some general system
call like "select","read","write" etc, to
do network communication. The problem is that
when I change it to C++ fomat and use g++ 2.7.2
with g++lib 2.7.1 in SunOS 4.1.3 to compile the
program, some protype warning error occur.

How to using the old C standard library and system call
in a C++ program, how to include the protype of them?

I list some part of my program had occured error as follows:
server.C:42: aggregate `struct sockaddr_in fsin' has incomplete type and
cannot be initialized
server.C:52: warning: implicit declaration of function `int bzero(...)'
server.C:54: warning: implicit declaration of function `int getdtablesize
(...)'
server.C:56: warning: implicit declaration of function `int bcopy(...)'
server.C:57: warning: implicit declaration of function `int select(...)'
server.C:64: warning: implicit declaration of function `int accept(...)'

Thanks if anyone can solve the problem!!!!


Nobody can solve it here, you need to post to the newsgroup for your OS.
Those functions are not standard C or C++ ones, they are most likely part
of your OS programming library. If it's so, you simply need to read about
them in your OS programming manual, and then include proper headers into
your 'server.C' file, somewhere at the top...

V
Jul 28 '05 #2

P: n/a
Melquíades wrote:
How to using the old C standard library and system call
in a C++ program, how to include the protype of them?


Read the documentation of those functions in your system, here will be
described which headers you need to include.

--
Salu2
Jul 28 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.