Can anyone help me with swig i’m stuck!
My C++
#ifndef _SOME_CLASS_H_
#define _SOME_CLASS_H_
class SomeClass
{
private:
int mValA;
int mValB;
public:
SomeClass() { }
SomeClass(int a, int b) { }
virtual ~SomeClass() { }
void MethodA(){ }
void MethodB(int a = 5)
{
mValB= b;
}
int GetValA()
{
return mValA;
}
};
#endif // _SOME_CLASS_H_
The interface file:
%module mymodule
%{
#include "some_class.h"
%}
class SomeClass
{
public:
SomeClass();
virtual ~SomeClass();
void MethodA();
void MethodB(int a = 5);
int GetValA();
};
i run
swig.exe -c++ -python -o mymodule_wrap.cpp mymodule.i
and build a dll with MSVC7
renamed it to _mymodule.dll
when i try to import mymodule i get this:
>>> import mymodule
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "mymodule.py", line 5, in ?
import _mymodule
ImportError: No such file or directory
Is there anyone who uses SWIG.
Or is it better to use interrogate? If yes how to use it?
Thanks Martin