#1172 Generate Constructor error with optional arguments.

open
nobody
None
5
2012-12-21
2011-06-15
ladace
No

code like following:

%rename \(Label\) ILabel;
class ILabel
    : public video::INode
\{
public:
    virtual void setText\(OneU::pcwstr text\);
    virtual OneU::pcwstr getText\(\);
    virtual void setColor\(OneU::color\_t color\);
    virtual OneU::color\_t getColor\(\);
    virtual void setAlpha\(OneU::ubyte alpha\);
    OneU::ubyte getAlpha\(\);
    virtual void setAlign\(OneU::uint32 align\);
\};

%extend ILabel\{
    ILabel\(float Width, float Height, OneU::uint32 fontSize, OneU::pcwstr fontName = "Arial"\)\{
        return Label\_create\(Width, Height, fontSize, fontName\);
    \}
\};

An error occurs, says
Label.i(30) : Error: 'Label_allocate' is multiply defined in the generated targe
t language module in scope .
Label.i(30) : Error: Previous declaration of 'Label_allocate'
Label.i(30) : Error: 'new_Label' is multiply defined in the generated target lan
guage module in scope .
Label.i(30) : Error: Previous declaration of 'new_Label'

if I delete the %rename line, it works. And if I delete the optional argument, it works, too.
Maybe the contructor was generated twice.

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks