W3C home > Mailing lists > Public > www-lib@w3.org > January to March 1996

Re: C++

From: Henrik Frystyk Nielsen <frystyk@w3.org>
Date: Mon, 26 Feb 1996 11:40:07 -0500
Message-Id: <9602261640.AA15265@www20>
To: Jiang Tao <jiangt@ceci.mit.edu>
Cc: holmberg@frame.com, www-lib@w3.org
Jiang Tao writes:
> holmberg@frame.com wrote:
> > 
> >  As other parts of my application
> > > are written with c++, so I hope HTCallClient() will be in
> > > a c++ file, but this seems to cause compiler error as the
> > > lib is written with c ( you can call c function in c++ program,
> > > however, you can not call c++ function in c program, at least
> > > with MSVC).
> > 
> > It's true you can't call a C++ function from a C function
> > compiled with a C compiler.  But you can call a C function
> > compiled with a C++ compiler, which in turn can call a
> > C++ function.  I.e., write some wrappers around your
> > C++ code in C, compile them with the C++ compiler, and
> > use these as your callbacks.
> > 
> > Greg
> 
> You got the point. I should compile the lib with c++ compiler 
> (MSVC has option "disable language extension" off as default,
> so I should turn it on).
> 
> However, it seems a lot of compiler errors when I begin
> to compile lib with c++ compiler both on UNIX (sun, CC) and
> windows NT, what should I do then?

It's true that the c++ (or in my case g++) produces more errors but most of 
them are not `important' (however, I _do_ fix them when I find them!). Are you 
getting errors or just warnings?


-- 

Henrik Frystyk Nielsen, <frystyk@w3.org>
World-Wide Web Consortium, MIT/LCS NE43-356
545 Technology Square, Cambridge MA 02139, USA
Received on Monday, 26 February 1996 11:40:22 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:26 GMT