Hi Eric,
FWIW, I recall their being issues that prevent mixing MVC++ with the other
compilers. I thought it was a name mangling issue, but I think that would
show up when linking. It seems to be a general property of C++ compilers
that they don't play well with each other.
Tom
"eric"
<eric@scipy.org To: wxpython-users@lists.wxwindows.org
> cc: (bcc: Tom Fenn/US-Corporate/3M/US)
10/30/01 04:36 mingw32 that works with wxPython binaries?
PM
Please respond
to
wxpython-users
Hello,
I need to build an extension module that has wxWindows/wxPython code in it
using mingw32. It also needs to work with the standard wxPython binaries
(dlls) which are compiled with MSVC++. I've attached a very simple
extension module function that asks a wxFrame if it is Maximized or not.
It
will run fine if compiled with MSVC, but seg-faults if compiled with
mingw32. I've played all the tricks I know about with converting .lib
files
to .a files using tools like impdef and dllwrap, but they don't seem to
matter.
c:\wx230\lib> impdef.exe wx23_1.dll > wx23_1.def
c:\wx230\lib> dlltool --def wx23_1.def --dllname wx23_1.dll --output-lib
libwx23_1.a -k
A similar process works fine when processing python21.lib to make a
libpython21.a file. Linking to the libpython21.a file using gcc works
without a hitch. I'm guessing this is because python21.lib (and dll) are
pure C code, and wxPython is C++. Does anyone know if there are binary
compatibility issues between gcc and MSVC that come up with C++ code that
do
not exist with C code? Has anyone successfully built wxPython extension
modules with gcc that are interoperable with the standard wxPython dlls?
thanks,
eric
-------------------- simple code ----------------------------
static wxFrame* py_to_wxFrame(PyObject* py_obj,char* name)
{
wxFrame *wx_ptr;
if (SWIG_GetPtrObj(py_obj,(void **) &wx_ptr,"_wxFrame_p"))
handle_bad_type(py_obj,"wxFrame", name);
return wx_ptr;
}
static PyObject* test(PyObject*self, PyObject* args, PyObject* kywds)
{
PyObject *return_val = Py_None;
PyObject *py_local_dict = NULL;
static char *kwlist[] = {"a","local_dict", NULL};
PyObject *py_a;
py_a = NULL;
if(!PyArg_ParseTupleAndKeywords(args,kywds,"O|O:test",kwlist,&py_a,
&py_local_dict))
return NULL;
try
{
wxFrame *a = py_to_wxFrame(py_a,"a");
int i = a->IsMaximized();
}
catch( Py::Exception& e)
{
return_val = Py::Null();
}
return return_val;
}
···
Subject: [wxPython] Any way to build an extension module with
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users