On Tue, Sep 22, 2009 at 7:27 PM, Phil Thompson <span dir="ltr"><<a href="mailto:phil@riverbankcomputing.com" target="_blank">phil@riverbankcomputing.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Tue, 22 Sep 2009 19:17:12 +0200, Arve Knudsen <<a href="mailto:arve.knudsen@gmail.com" target="_blank">arve.knudsen@gmail.com</a>><br>
<div><div>wrote:<br>
> On Tue, Sep 22, 2009 at 6:28 PM, Phil Thompson<br>
> <<a href="mailto:phil@riverbankcomputing.com" target="_blank">phil@riverbankcomputing.com</a>>wrote:<br>
><br>
>> On Mon, 21 Sep 2009 18:40:35 +0200, Arve Knudsen<br>
<<a href="mailto:arve.knudsen@gmail.com" target="_blank">arve.knudsen@gmail.com</a>><br>
>> wrote:<br>
>> > Hi<br>
>> ><br>
>> > I have run into this problem where a C++ exception is not correctly<br>
>> > translated into Python on Linux (it works under VC++ on Windows). The<br>
>> > exception is apparently not caught as it should, but looking at the<br>
>> > SIP-generated sourcecode I cannot see why (there is a try/catch block<br>
>> > for<br>
>> > the exception). Any ideas as to what might be going wrong here? I have<br>
>> > tried<br>
>> > std::exception instead of my custom exception, and this gets<br>
translated<br>
>> > correctly to Python.<br>
>> ><br>
>> > Attached I have a simple library 'raiser', which is wrapped by the<br>
>> > Python<br>
>> > module 'raiser'. In order to build it, first build a shared library<br>
>> > from<br>
>> > 'raiser.cpp', then run 'configure.py' and make.<br>
>><br>
>> Works fine for me on Linux with the current SIP snapshot. I did change<br>
>> your<br>
>> code first to make everything in-line so it wasn't necessary to build a<br>
>> separate library.<br>
><br>
><br>
> By inlining you remove the problem of interest, which is to propagate an<br>
> exception from one library to another. It also works for me when<br>
inlining,<br>
> so try my original version please.<br>
<br>
</div></div>That implies it's a build system issue. Can you send me the Makefile you<br>
are using to build the library so that I know I'm exactly reproducing what<br> you are doing.</blockquote><div><br></div><div>For this particular case, you can do the simplest thing possible: g++ -shared -o libraiser.so raiser.cpp.</div>
<div><br></div><div>Arve </div>