Subject: RE: [linux-audio-dev] DSP resources
From: STEFFL, ERIK *Internet* (SBCSI) ("STEFFL,)
Date: Mon Sep 10 2001 - 22:42:51 EEST
> -----Original Message-----
> From: Juhana Sadeharju [mailto:kouhia_AT_nic.funet.fi]
...
> Anyone know how to get overloaded complex number operations to C
> without rewriting everything in pure C++ style. It is possible
> just to switch compiler to g++ for those files which uses the complex
> number operations? Can those object files (functions) then be included
> to a program compiled with C?
>
> I already have c_mul(), c_add(), etc. functions but they are really
> boring to use. I also have simple wrapper routines for using Pari/Gp
> for (non-realtime) computations; Pari/Gp can be found from
> "www.parigp-home.de". Because it can compute with complex numbers
> it is as easy to use as overloading (but not as efficient).
...
you can combine C++ and C easily - most of the C code is valid C++ code so
you can have a basically C program that uses some C++ classes (e.g. complex
numbers).
you just compile the whole thing using c++ compiler (g++) (I don't mean
the whole project, just the files that use C++ classes)
for C libraries, use extern "C" { } in include file (most of the standard
C include files already use it (should use it) - see e.g. stdio.h)
you have to be more careful about typing, some of the 'looser' definitions
are not accepted by C++ compiler.
erik
This archive was generated by hypermail 2b28 : Mon Sep 10 2001 - 22:42:35 EEST