From: SourceForge.net <no...@so...> - 2011-06-15 16:24:58
|
Bugs item #3316876, was opened at 2011-06-16 00:24 Message generated for change (Tracker Item Submitted) made by ladace You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=3316876&group_id=1645 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: ladace (ladace) Assigned to: Nobody/Anonymous (nobody) Summary: Generate Constructor error with optional arguments. Initial Comment: 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. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=3316876&group_id=1645 |