rs@heike.informatik.uni-dortmund.de (Roland Schwan) (06/26/91)
Hello netters! Is there any chance to call a C++- method from a c-program? Such as : ...c-file: main() {.... .. something(); .... } ...c++-file: .... void something(); { cout << "Output of c++ \n"; } When I tried this, all I got was a core dumped. Any ideas? Roland. ____________________________________________________ Roland Schwan rs@heike.informatik.uni-dortmund.de It's better to burn out, than to fade away! (Kurgan) ____________________________________________________
raeburn@athena.mit.edu (Ken Raeburn) (06/27/91)
In article <3575@laura.UUCP> rs@heike.informatik.uni-dortmund.de (Roland Schwan) writes: ...c-file: main() {.... .. something(); .... } The problem here is that some C++ implementations (UNIX ones at least -- I haven't used others, and you didn't say what you were using) require that `main' be compiled as C++ code, in order for constructors for static objects to be run. If you can't move this `main' routine into a C++ file, rename it to `main2' or something, and add a new `main' routine in a C++ file which simply calls `main2'.