[Insight-users] Re: WrapITK: more windows build errors
Zachary Pincus
zpincus at stanford.edu
Tue Feb 14 15:02:36 EST 2006
Well, that's confusing. I've really got no idea what would be causing
this problem.
I can't speak with any authority what removing wrapping for
itkMultiThreader would do. If you want, feel free to try it by
changing the name of WrapITK/CommonA/wrap_itkMultiThreader.cmake to
something else (Gaetan appends '.notwrapped' to the end of the name).
However, I would be first tempted to try using the CVS version of
CableSwig -- this might be a Swig bug, which perhaps was fixed in CVS.
One useful note: when I'm performing test builds just to see if the
darn thing will compile, I like to configure WrapITK to only build
for 2-dimensional images of a single data type (e.g. float) -- this
speeds up compile time substantially.
Zach
PS. I have an eventual solution to getting rid of bizarre SWIG
errors. I'd like to some day write something that can parse GCC_XML
output and generate input files for a current version of SWIG. This
may or may not be impossible, but if it were possible, then we could
use modern versions of SWIG with WrapITK, instead of using CableSwig,
which as Brad has mentioned, is a real pain to keep maintained. If
anyone is interested in this kind of project, let me know.
On Feb 14, 2006, at 1:26 PM, Charl P. Botha wrote:
> Hi there guys, it's me again.
>
> My Windows build was chugging along nicely, until it ran into the
> following error:
>
> c:\build\WrapITK-VS71\CommonA\wrap_ITKCommonBasePython.cxx(4536):
> error C2664: 'itk::MultiThreader::SetMultipleMethod' : cannot convert
> parameter 2 from 'unsigned long (__cdecl *)(void *)' to
> 'itk::ThreadFunctionType'
>
> The code in question is reproduced below, the line in question is
> "(*arg1)->SetMultipleMethod(arg2,arg3,arg4);".
>
> (it finds similar errors for "SetSingleMethod" and "SpawnThread",
> twice each.)
>
> This looks like standard cableswig generated code, so unless you guys
> know exactly where I could start looking to fix this, I'd be tempted
> to remove the itkMultiThreader wrapping from wrap_ITKCommonBase.cmake,
> or would this be bad?
>
> Thanks for any info,
> Charl
>
> The code:
> static PyObject
> *_wrap_itkMultiThreader_Pointer_SetMultipleMethod(PyObject *, PyObject
> *args) {
> PyObject *resultobj;
> itk::SmartPointer<itk::MultiThreader > *arg1 =
> (itk::SmartPointer<itk::MultiThreader > *) 0 ;
> int arg2 ;
> unsigned long (*arg3)(void *) = (unsigned long (*)(void *)) 0 ;
> void *arg4 = (void *) 0 ;
> PyObject * obj0 = 0 ;
> PyObject * obj1 = 0 ;
> PyObject * obj2 = 0 ;
> PyObject * obj3 = 0 ;
>
> if(!PyArg_ParseTuple(args,(char
> *)"OOOO:itkMultiThreader_Pointer_SetMultipleMethod",&obj0,&obj1,&obj2,
> &obj3))
> goto fail;
> if ((SWIG_ConvertPtr(obj0,(void
> **)(&arg1),SWIGTYPE_p_itk__SmartPointerTitk__MultiThreader_t,
> SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
> arg2 = (int) SWIG_AsInt(obj1);
> if (PyErr_Occurred()) SWIG_fail;
> if ((SWIG_ConvertPtr(obj2,(void
> **)(&arg3),SWIGTYPE_p_f_p_void__unsigned_long,
> SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail;
> if ((SWIG_ConvertPtr(obj3,&arg4,0,SWIG_POINTER_EXCEPTION | 0)) ==
> -1) SWIG_fail;
> try {
> (*arg1)->SetMultipleMethod(arg2,arg3,arg4);
> }
> catch(std::exception &_e) {
> {
> if ( strstr(const_cast<char*>(_e.what()), ": index out of
> range") == NULL ) {
> SWIG_exception(SWIG_RuntimeError, const_cast<char*>
> (_e.what()));
> }
> else {
> PyErr_SetString(PyExc_IndexError, const_cast<char*>
> (_e.what()));
> return NULL;
> }
> }
> }
>
> Py_INCREF(Py_None); resultobj = Py_None;
> return resultobj;
> fail:
> return NULL;
> }
More information about the Insight-users
mailing list