#83 1.3.8 not emitting ctor code

closed-works-for-me
python (259)
5
2001-12-06
2001-09-24
No

The following simple interface file defines a
constructor, destructor and an integer data member.

%module spam
%{
%}

class Spam
{
public:
Spam();
~Spam();

int data;
};

When this is run through swig-1.3.8 using:

swig -c++ -python -shadow -no_default spam.i

I find code for delete_Spam(), Spam_data_set()
and Spam_data_get() in the wrapper code. But new_Spam()
(or whatever should make a new Spam) seems to be
missing. The shadow file has two constructors:

class SpamPtr(Spam):
def __init__(self,this):

and

class Spam:
def __init__(self,this):

So, I think that a new instance of Spam
can not be created from python (since we
don't have a this). Or am I missing
something?

Discussion

  • David M. Beazley

    Logged In: YES
    user_id=7557

    From private correspondence: this appears to be a compiler
    problem related to compiling SWIG with -O3 and gcc-3.0.1.
    With different options it works. Looking into it.

     
  • David M. Beazley

    • assigned_to: nobody --> beazley
    • status: open --> open-works-for-me
     
  • David M. Beazley

    • status: open-works-for-me --> closed-works-for-me
     

Log in to post a comment.