Register Class Twice error

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Register Class Twice error

Stephan Jauernick
Hello,
I am getting this error when i am trying to register the class
Entity(code:http://abc123.pastebin.com/d4766493a):
http://abc123.pastebin.com/d5dab447f i am using windows xp and i compile
on mingw

do you have any idea how to debug that?
Sincerly,
Stephan Jauernick

------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user

stephan.vcf (116 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Register Class Twice error

Tom McCubbin-2
Stephan,

It would seem clear that you are inadvertently calling Script::addServerFunctions() twice.  If you have the tools to generate a call graph you can find it quickly.  Alternatively, run it in a debugger and do a back trace to see the offending caller.  

If you can't find it, you'll need to pastebin or otherwise post some more of the code...hope that gets you started.

-tom

On Sun, Jun 21, 2009 at 6:28 AM, Stephan Jauernick <[hidden email]> wrote:
Hello,
I am getting this error when i am trying to register the class
Entity(code:http://abc123.pastebin.com/d4766493a):
http://abc123.pastebin.com/d5dab447f i am using windows xp and i compile
on mingw

do you have any idea how to debug that?
Sincerly,
Stephan Jauernick

------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user



------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

Re: Register Class Twice error

Stephan Jauernick
Hi,
Sadly i dont have  the tools to generate a call graph.
But when the function is called twice wouldnt it then complain on  the Game Class too?(i checked it it dies always at the Entity register call.)
Another thing if i remove the  EntityPointer  from this line luabind::class_<Entity, EntityPointer>("Entity") it works.
And how to debug the caller? when i run it in gdb i dont get a backtrace.

Heres the  complete file in the  github repo: http://github.com/mgottschlag/backlot/blob/ce32caef71b095b0dfe0fca013887e89645822d6/src/Script.cpp

Stephan Jauernick

Tom McCubbin schrieb:
Stephan,

It would seem clear that you are inadvertently calling Script::addServerFunctions() twice.  If you have the tools to generate a call graph you can find it quickly.  Alternatively, run it in a debugger and do a back trace to see the offending caller.  

If you can't find it, you'll need to pastebin or otherwise post some more of the code...hope that gets you started.

-tom

On Sun, Jun 21, 2009 at 6:28 AM, Stephan Jauernick <[hidden email]> wrote:
Hello,
I am getting this error when i am trying to register the class
Entity(code:http://abc123.pastebin.com/d4766493a):
http://abc123.pastebin.com/d5dab447f i am using windows xp and i compile
on mingw

do you have any idea how to debug that?
Sincerly,
Stephan Jauernick

------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user



------------------------------------------------------------------------------ Are you an open source citizen? Join us for the Open Source Bridge conference! Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250. Need another reason to go? 24-hour hacker lounge. Register today! http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org

_______________________________________________ luabind-user mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/luabind-user


------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user

stephan.vcf (116 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Register Class Twice error

Daniel Wallin
On 6/21/09 5:18 PM, Stephan Jauernick wrote:
> Hi,
> Sadly i dont have  the tools to generate a call graph.
> But when the function is called twice wouldnt it then complain on  the
> Game Class too?(i checked it it dies always at the Entity register call.)
> Another thing if i remove the  EntityPointer  from this line
> luabind::class_<Entity, EntityPointer>("Entity") it works.

I'm guessing it's because your get_const_holder() overload returns the
smart pointer type unmodified:

  template<class A>
  SharedPointer<A>* get_const_holder(SharedPointer<A>*)
  {
    return 0;
  }

Can you try doing this instead:

  template<class A>
  SharedPointer<A const>* get_const_holder(SharedPointer<A>*)
  {
    return 0;
  }

--
Daniel Wallin
BoostPro Computing
http://www.boostpro.com

------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

Re: Register Class Twice error

Stephan Jauernick
Hi again,
When i try Daniels sollution i get these errors:
http://abc123.pastebin.com/d46e52a62

Sincerly,
Stephan Jauernick

Daniel Wallin schrieb:
On 6/21/09 5:18 PM, Stephan Jauernick wrote:
  
Hi,
Sadly i dont have  the tools to generate a call graph.
But when the function is called twice wouldnt it then complain on  the
Game Class too?(i checked it it dies always at the Entity register call.)
Another thing if i remove the  EntityPointer  from this line
luabind::class_<Entity, EntityPointer>("Entity") it works.
    

I'm guessing it's because your get_const_holder() overload returns the
smart pointer type unmodified:

  template<class A>
  SharedPointer<A>* get_const_holder(SharedPointer<A>*)
  {
    return 0;
  }

Can you try doing this instead:

  template<class A>
  SharedPointer<A const>* get_const_holder(SharedPointer<A>*)
  {
    return 0;
  }

  


------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user

stephan.vcf (116 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Register Class Twice error

Stephan Jauernick
Hi again,
Okay thx for your help!
With a other Developer we were able to fix the errors!

Sincerly,
Stephan Jauernick

Stephan Jauernick schrieb:
Hi again,
When i try Daniels sollution i get these errors:
http://abc123.pastebin.com/d46e52a62

Sincerly,
Stephan Jauernick

Daniel Wallin schrieb:
On 6/21/09 5:18 PM, Stephan Jauernick wrote:
  
Hi,
Sadly i dont have  the tools to generate a call graph.
But when the function is called twice wouldnt it then complain on  the
Game Class too?(i checked it it dies always at the Entity register call.)
Another thing if i remove the  EntityPointer  from this line
luabind::class_<Entity, EntityPointer>("Entity") it works.
    

I'm guessing it's because your get_const_holder() overload returns the
smart pointer type unmodified:

  template<class A>
  SharedPointer<A>* get_const_holder(SharedPointer<A>*)
  {
    return 0;
  }

Can you try doing this instead:

  template<class A>
  SharedPointer<A const>* get_const_holder(SharedPointer<A>*)
  {
    return 0;
  }

  

------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org

_______________________________________________ luabind-user mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/luabind-user


------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user

stephan.vcf (116 bytes) Download Attachment