🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by John T Riedl Thu, 05 Oct 1989 21:14
using C header files with C++
#162
Author: John T Riedl
Date: Thu, 05 Oct 1989 21:14
10 lines
842 bytes
I have a library of C routines that I want to use from C++.  Of
course, the function declarations in the header file are in C form
without any argument specifications (e.g., int f();).  Is there a
trick to get G++ to accept these declarations?  If not, is there a
solution that doesn't require me to make a separate header file for
G++ (with the '...' argument notation)?  How do other people solve
this problem?

Thanks,
John
Re: using C header files with C++
#163
Author: Doug Schmidt
Date: Thu, 05 Oct 1989 22:27
20 lines
1616 bytes
In article <RIEDL.89Oct5161459@medusa.cs.purdue.EDU>, riedl@cs (John T Riedl) writes:
>I have a library of C routines that I want to use from C++.  Of
>course, the function declarations in the header file are in C form
>without any argument specifications (e.g., int f();).  Is there a
>trick to get G++ to accept these declarations?  If not, is there a
>solution that doesn't require me to make a separate header file for
>G++ (with the '...' argument notation)?  How do other people solve
>this problem?

Try using the -fno-strict-prototype option.  Perhaps a better
long-term solution is to get ahold of Ron Guilmette's `protoize'
program and ANSIify your header files...  You can contact 
Ron at rfg@ics.uci.edu.

Doug
--
schmidt@ics.uci.edu (ARPA) |   Per me si va nella citta' dolente.
office: (714) 856-4043     |   Per me si va nell'eterno dolore.
                           |   Per me si va tra la perduta gente.
                           |   Lasciate ogni speranza o voi ch'entrate.
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