C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Proting C source to C++ ?

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++)
View previous topic :: View next topic  
Author Message
Melquíades
Guest





PostPosted: Thu Jul 28, 2005 4:37 pm    Post subject: Proting C source to C++ ? Reply with quote



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!!!!
Back to top
Victor Bazarov
Guest





PostPosted: Thu Jul 28, 2005 4:44 pm    Post subject: Re: Proting C source to C++ ? Reply with quote



Melquíades wrote:
Quote:
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

Back to top
Julián Albo
Guest





PostPosted: Thu Jul 28, 2005 7:09 pm    Post subject: Re: Proting C source to C++ ? Reply with quote



Melquíades wrote:

Quote:
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

Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.