Path: utzoo!attcan!uunet!tektronix!sequent!mntgfx!archiel From: archiel@mntgfx.mentor.com (Archie Lachner) Newsgroups: comp.sys.apollo Subject: Re: C++ vs Apollo Sys Files ? (Long) Compatability ? Message-ID: <1989Mar10.125408.2077@mntgfx.mentor.com> Date: 10 Mar 89 20:54:07 GMT References: <1093@cheops.eecs.unsw.oz> Organization: Mentor Graphics Corporation, Beaverton Oregon Lines: 37 From article <1093@cheops.eecs.unsw.oz>, by ashley@cheops.eecs.unsw.oz (Ashley M. Aitken): > Howdy, > > Just when I thought C++ would add some productivity to my existence all hell > breaks loose (forgive me please, it is late, very late). I am having severe > problems with C++ and Apollo C System files compatability. > > Can someone, anyone shed some light ? > > The situation is as follows. I am programming in C++ Version 1.2.1 under SR10.1 > with SR10? release of C (I think). Anyway the C++ language works well so the C > must be later that V6.00. The problems are with Header Files, that seem to be > incompatible with this C++ (but not the C). For example .. > > The following code (I know some of them ain't C++ files ie stdio.h is not ) We have found that the only way to insure correct compilation, linking, and execution is to generate C++ versions of the C header files. In practice this means taking the Apollo header files and modifying them so that they describe things using C++ syntax. This is painful to do the first time, but updating them with Apollo header-file changes is not too bad. In general, C++ and C are two different languages. C++ is not upward compatible with C, not matter who says so. The two languages can be made link compatible, but there are thing you must do on the C++. Writing C++ headers for the C functions you use is one of those things. You may want to ask your Apollo representative if they have any C++ header files for the C library. P.S. If you're using C++, why not use the streams package instead of stdio? -- Archie Lachner Mentor Graphics Corporation Beaverton, Oregon ...!{decwrl,sequent,tessi}!mntgfx!archiel