[Top][All Lists]

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

#define conflict with swig

From: John W. Eaton
Subject: #define conflict with swig
Date: Sun, 21 Aug 2005 13:20:30 -0400

On 21-Aug-2005, jon wrote:

|     I've been attempting to embed both octave and python in a third program
| using the swig interface generator.  Using the usual oct.h includes in 
| an octave.i
| file, I get
| address@hidden:~/develop/octave-py $ swig -c++   -python octave.i
| octave/config.h:768: Error: Macro 'DYNAMIC_CAST' redefined,
| /usr/share/swig1.3/swig.swg:382: Error: previous definition of 
|     It appears part of the magic swig does uses DYNAMIC_CAST cleverly, 
| and that
| collides with octave's version.
|     Is there anything to do other than getting octave sources, and 
| rebuilding after using sed
| to effect a s/DYNAMIC_CAST/_DYNAMIC_CAST/g on the whole octave source 
| tree ? 
| That would probably work, but make the project unmaintainable.

I used these macros because I wanted to be able to make Octave work on
systems where the C++ compiler did not yet implement dynamic_cast,
reinterpret_cast, and static_cast.  These days, I think we can assume
that the C++-style casts will be available in any compiler that is
capable of compiling Octave.  So maybe now would be a good time to
replace these macros in Octave with the actual C++-style casts in the


Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]