logo       

Re: new to swig, problems with exceptions: msg#00143

programming.swig

Subject: Re: new to swig, problems with exceptions


On Nov 24, 2003, at 3:03 AM, Ian_Haycock@xxxxxxxxxxx wrote:

Basically I can use MyClass fine in python (or perl),
but whenever there's an exception python (or perl) crashes. The
use of %exception doesn't seem to make any difference
to that, and more specifically it doesn't make any
difference to the SWIG generated C++ code.

Am I missing something really basic here, I figure I
must be as all the documentation indicates that
exception handling is trivial and I can't see any
other posts with people having this problem.


It's hard to say what might be going on here. However, I would check a couple
of things. First, make sure that the %exception code is actually showing up
in the generated wrappers. The fact that you defined the exception handler
in a namespace like that might have some adverse effects (like only attaching
the exception to declarations in that namespace). If, for some reason, the
%exception code is missing, that would explain a crash. It's also possible that
there is some kind of linking problem. Double check the compiler/linker flags and
make sure that exceptions are enabled or compiled properly. I know on earlier
compilers, you sometimes had to specify extra options to make exceptions work
correctly with dynamically loadable modules.

Cheers,
Dave

_______________________________________________
Swig maillist - Swig@xxxxxxxxxxxxxxx
http://mailman.cs.uchicago.edu/mailman/listinfo/swig



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise