POV-Ray : Newsgroups : povray.programming : mixing POV code with C++ : Re: mixing POV code with C++ Server Time
29 Jul 2024 00:32:24 EDT (-0400)
  Re: mixing POV code with C++  
From: Thorsten Froehlich
Date: 12 Feb 1999 02:25:01
Message: <36c3d74d.0@news.povray.org>
In article <36C3426B.32FC9456@public.uni-hamburg.de> , Daniel Fenner 
<Dan### [at] publicuni-hamburgde>  wrote:

> 1)  I guess 'extern "C" {...}' is used to include C headers into C++
> files
>     (correct me if I am wrong)
>     What I need is the opposite : including a C++ header into a C file.

Some compilers allow to enforce this with a cdecl declaration of a function.
Instead of
void foo();
you would write
void cdecl foo();
However, cdecl is _not_ an ISO C or ISO C++ keyword and might not work with
your compiler.

> 2)  As a work-around I compiled the hole source code as C++. (the option
>     for VC5.0 is /TP) I'm not completly happy with this. A lot of things
>     had to be changed (prototypes and typecasts mainly) Furthermore the
>     linker now produces some unresolved references I can not explain.
>     I used /FORCE and had luck :->.

Hmm, this is strange. Where were these changes required? In the core code or
in the platform specific code? The core code itself should compile without
error using a C++ compiler...if it does not, it would be very interesting
where VC had problems.


    Thorsten


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.