[Prev][Next][Index][Thread]

Re: C++



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





Follow-Ups: