logo       

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

programming.swig

Subject: Re: new to swig, problems with exceptions


Dave

thanks for your help, it looks like it was the namespace that was causing
the problem.
I kept my class inside my namespace declaration but moved the %exception
clause out of the namespace and it now works a treat.
Now I can get on and use SWIG in anger, it looks like a lot of fun
once again thanks for your help

Ian





David Beazley

<beazley@signal6.

com>





24/11/2003 12:46 To:
Ian_Haycock@xxxxxxxxxxx
cc:
swig@xxxxxxxxxxxxxxx, David Beazley
<beazley@xxxxxxxxxxx>

bcc:

Subject:
Re: [Swig] 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





This e-mail, including attachments, is intended for the person(s) or
company named and may contain confidential and/or legally privileged
information. Unauthorized disclosure, copying or use of this information
may be unlawful and is prohibited. If you are not the intended recipient,
please delete this message and notify the sender



_______________________________________________
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