compile error on SWIG file

Markus von Ehr markus.vonehr at ipm.fhg.de
Mon Sep 9 11:35:46 EDT 2002


Hi,

I only extended the std_vector example from the distribution with
one function, see example.i included (there are templates inside).
When I run SWIG with -c++ option, the warnings disappear in fact.
But the error from the compiler is the same...

Thanks,

Markus


/* File : example.i */
%module example

%{
#include "example.h"
%}

%include stl.i
/* instantiate the required template specializations */
namespace std {
    %template(IntVector)    vector<int>;
    %template(DoubleVector) vector<double>;
}

/* Let's just grab the original header file here */
%include "example.h"


Lyle Johnson schrieb:
> 
> Markus von Ehr wrote:
> 
> > compiling my c-file generated from SWIG
> > (swig -c -python -o mvelib.c mvelib.i)
> > with a setup-file, I receive the error:
> >
> > c:\programme\vc98\include\eh.h(32) : fatal error C1189: #Error: "eh.h
> > is only for C++!"
> >
> > Anybody knows what I have to change?
> 
> Is it a C++ library that you're wrapping (sounds that way)? If so, you'd
> want to run SWIG with the -c++ option to tell it that.



More information about the Python-list mailing list