Hello,
I'm taking my first stab at wrapping some wxWidgets C++ with wxPython
-aware SWIG. I'm having trouble including the right .i files from my
.i file.
python: 2.5.4.1 with Robin's wxWidgets lib and includes. I think it's
missing the .py files from the
wxPython-2.5.4.1\include\wx\wxPython\i_files directory, so I copied
those in from the wxWidgets/wxPython/src directory in wxWidgets head
CVS. (hoping they're not too different.)
SWIG: latest + robin's patches compiled with MinGW.
I'm compiling with VC++ 6.0
I've gotten pretty far, I created a DLL sucessfully, and imported it,
but when I tried to pass it a python string as for a wxString
parameter, it complained it couldn't convert. So now I'm trying to
include the right .i files so that swig sees the wxPython definitions.
My .i file looks like:
%define DOCSTRING
"Zoomable image reader for Zoomify format"
%enddef
%module(package="bright", docstring=DOCSTRING) zoomify
%{
#include "imaging/big/ZoomableImageReader.h"
#include "imaging/big/zoomifyReaderWx.h"
%}
%import windows.i
%import controls.i
%pythoncode { import wx }
class ZoomifyReaderWx
{
public:
%pythonAppend ZoomifyReaderWx "self._setOORInfo(self)"
bool Open(wxString filename);
void Close();
...
And the erros I get look like:
erforming Custom Build Step on ..\..\..\src\imaging\big\zoomifyReaderWx.i
..\..\..\libs\wxPython-2.5.4.1\include\wx\wxPython\i_files\_window.i(734):
Warning(302): Identifier 'PopupMenuXY' redefined (ignored) (Renamed
from 'PopupMenu'),
..\..\..\libs\wxPython-2.5.4.1\include\wx\wxPython\i_files\_window.i(733):
Warning(302): previous definition of 'PopupMenuXY' (Renamed from
'PopupMenu').
Compiling...
zoomifyReaderWx.cpp
zoomifyReaderWx_wrap.cpp
C:\jimc\bright\samples\wxPyHybrid\pyZoominfy\gen\zoomifyReaderWx_wrap.cpp(1562)
: error C2065: 'wxString_in_helper' : undeclared identifier
C:\jimc\bright\samples\wxPyHybrid\pyZoominfy\gen\zoomifyReaderWx_wrap.cpp(1562)
: error C2440: 'initializing' : cannot convert from 'int' to 'class
wxString *'
Conversion from integral type to pointer type requires
reinterpret_cast, C-style cast or function-style cast
C:\jimc\bright\samples\wxPyHybrid\pyZoominfy\gen\zoomifyReaderWx_wrap.cpp(1568)
: error C2065: 'wxPyBeginAllowThreads' : undeclared identifier
How can I figure out what I haven't included?
Thanks!
-Jim