[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: C++ variant of OpenLDAP 2.0 alpha3




Mikael wrote:

> Hi again!
>
> Randy Kunkee wrote:
>
> > Mikael,
> >
> > Isn't that what the whole 'extern "C" {' stuff is about?  Sounds like you
> > will need to wrap the OpenLDAP include files (ldap.h, ...) with #ifdefs
> > that check for a C++ compiler, and if it is, execute the 'extern "C" {'
> > and '}' at the beginning and end of the include files, respectively.
> > Any C++ compiler should accept .c extensions as regular C source.
> > I know this is the case with many Unix C compilers, including gcc.
> > The 'extern "C" {' should handle the interface aspect.
> >
> > Does that help any, or did you already know about 'extern "C" {' ?
> >
> > Randy Kunkee
> > NeoSoft, Inc.
>
> But I need to call C++ stuff FROM the openLdap package, so the interface of
> openLdap isnt important. The problem is that since all files end with .c and
> all project linkages etc etc is C based the compiler will automatically be a C
> compiler (using VisualC++ 6). I want to force the compiler to be C++ compiler
> compiling my C-files, ie I want to keep all OpenLDAP files and projects as
> they are (since I think it will be very hard to change everything to cpp) but
> be able to include new projects that have .cpp files and compile everything
> with c++ compiler.
>
> So...I dont thing wrapping every headerfile with 'extern "C"' will solve the
> problem but I might be wrong, please advise me further if anyone has a clue.
>
> --
>
> Sincerely
> Mikael

--

mvh
Mikael