Liker error while trying to extend and recompile irrlicht
-
- Posts: 105
- Joined: Thu Jan 10, 2008 6:26 pm
Liker error while trying to extend and recompile irrlicht
I am trying to create a custom IGUIElement in irrlicht, for that I have included the sources from irrlicht and extended the CIGUIStatictext class. Now whenever I try to compile my project , I get a host of linker errors , I must admit to ignorance of the compilation process and am not really able to figure out why this is happening. I'm including the source for both my header and cpp class as pastebin links :
Header : http://pastebin.com/5pCnHLG0
Cpp : http://pastebin.com/WtW36Qek
sample of the linker errors :
1>graphNode.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall irr::gui::CGUIStaticText::~CGUIStaticText(void)" (??1CGUIStaticText@gui@irr@@UAE@XZ) referenced in function __unwindfunclet$??0graphNode@gui@irr@@QAE@PAVIGUIEnvironment@12@PAVIGUIElement@12@HV?$rect@H@core@2@PB_W@Z$0 1>graphNode.obj : error LNK2019: unresolved external symbol "public: __thiscall irr::gui::CGUIStaticText::CGUIStaticText(wchar_t const *,bool,class irr::gui::IGUIEnvironment *,class irr::gui::IGUIElement *,int,class irr::core::rect const &,bool)" (??0CGUIStaticText@gui@irr@@QAE@PB_W_NPAVIGUIEnvironment@12@PAVIGUIElement@12@HABV?$rect@H@core@2@1@Z) referenced in function "public: __thiscall irr::gui::graphNode::graphNode(class irr::gui::IGUIEnvironment *,class irr::gui::IGUIElement *,int,class irr::core::rect,wchar_t const *)" (??0graphNode@gui@irr@@QAE@PAVIGUIEnvironment@12@PAVIGUIElement@12@HV?$rect@H@core@2@PB_W@Z) 1>graphNode.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall irr::gui::graphNode::OnEvent(struct irr::SEvent const &)" (?OnEvent@graphNode@gui@irr@@UAE_NABUSEvent@3@@Z) 1>graphNode.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall irr::gui::CGUIStaticText::updateAbsolutePosition(void)" (?updateAbsolutePosition@CGUIStaticText@gui@irr@@UAEXXZ) 1>graphNode.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall irr::gui::CGUIStaticText::draw(void)" (?draw@CGUIStaticText@gui@irr@@UAEXXZ) 1>graphNode.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall irr::gui::CGUIStaticText::setText(wchar_t const *)" (?setText@CGUIStaticText@gui@irr@@UAEXPB_W@Z)
Header : http://pastebin.com/5pCnHLG0
Cpp : http://pastebin.com/WtW36Qek
sample of the linker errors :
1>graphNode.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall irr::gui::CGUIStaticText::~CGUIStaticText(void)" (??1CGUIStaticText@gui@irr@@UAE@XZ) referenced in function __unwindfunclet$??0graphNode@gui@irr@@QAE@PAVIGUIEnvironment@12@PAVIGUIElement@12@HV?$rect@H@core@2@PB_W@Z$0 1>graphNode.obj : error LNK2019: unresolved external symbol "public: __thiscall irr::gui::CGUIStaticText::CGUIStaticText(wchar_t const *,bool,class irr::gui::IGUIEnvironment *,class irr::gui::IGUIElement *,int,class irr::core::rect const &,bool)" (??0CGUIStaticText@gui@irr@@QAE@PB_W_NPAVIGUIEnvironment@12@PAVIGUIElement@12@HABV?$rect@H@core@2@1@Z) referenced in function "public: __thiscall irr::gui::graphNode::graphNode(class irr::gui::IGUIEnvironment *,class irr::gui::IGUIElement *,int,class irr::core::rect,wchar_t const *)" (??0graphNode@gui@irr@@QAE@PAVIGUIEnvironment@12@PAVIGUIElement@12@HV?$rect@H@core@2@PB_W@Z) 1>graphNode.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall irr::gui::graphNode::OnEvent(struct irr::SEvent const &)" (?OnEvent@graphNode@gui@irr@@UAE_NABUSEvent@3@@Z) 1>graphNode.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall irr::gui::CGUIStaticText::updateAbsolutePosition(void)" (?updateAbsolutePosition@CGUIStaticText@gui@irr@@UAEXXZ) 1>graphNode.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall irr::gui::CGUIStaticText::draw(void)" (?draw@CGUIStaticText@gui@irr@@UAEXXZ) 1>graphNode.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall irr::gui::CGUIStaticText::setText(wchar_t const *)" (?setText@CGUIStaticText@gui@irr@@UAEXPB_W@Z)
http://irrlicht.sourceforge.net/phpBB2/ ... 029#143029
-Game Link added download and play
-Game Link added download and play
Re: Liker error while trying to extend and recompile irrlich
you don't have implemented OnEvent wich is pure virtual. If you want the old OnEvent of CGUIStaticText you ave to remove "OnEvent" from your header (there can still be more errors. at a first look is what I saw). Else you are supposed to provide your own version of OnEvent. It is better to look at few web tutorials about Polymorphism. they can help you a lot (check out also Thinking C++ wich is a great book).
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
-
- Posts: 105
- Joined: Thu Jan 10, 2008 6:26 pm
Re: Liker error while trying to extend and recompile irrlich
Yes , I realize that I havent , as of yet implemented all pure virtual methods, but the errors that I am getting are about Linking , If those could be resolved I can move on to resolve the more conventional problems with my program.REDDemon wrote:you don't have implemented OnEvent wich is pure virtual. If you want the old OnEvent of CGUIStaticText you ave to remove "OnEvent" from your header (there can still be more errors. at a first look is what I saw). Else you are supposed to provide your own version of OnEvent. It is better to look at few web tutorials about Polymorphism. they can help you a lot (check out also Thinking C++ wich is a great book).
http://irrlicht.sourceforge.net/phpBB2/ ... 029#143029
-Game Link added download and play
-Game Link added download and play
Re: Liker error while trying to extend and recompile irrlich
Is it, last time I checked IGUIElement had it implemented.REDDemon wrote:you don't have implemented OnEvent wich is pure virtual
http://irrlicht.sourceforge.net/docu/_i ... tml#l00514
Working on game: Marrbles (Currently stopped).
-
- Posts: 105
- Joined: Thu Jan 10, 2008 6:26 pm
Re: Liker error while trying to extend and recompile irrlich
If you're curious about the library being set up properly , the whole system was working fine , linking and all (along with displaying some static text on screen) until i decided to create my own version.
http://irrlicht.sourceforge.net/phpBB2/ ... 029#143029
-Game Link added download and play
-Game Link added download and play
Re: Liker error while trying to extend and recompile irrlich
what I mean is that he write the OnEvent method. no matters if it was implemented previously. Since when he write again the prototype in the header the linker expect it to be implemented again while he doesn't implemented it . So or he remove the prototype from the header or he just implement that again in the source file. If I'm correct there will not be compiling errors in this case but only linking errors.
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
Re: Liker error while trying to extend and recompile irrlich
You should probably inherit only the interface classes instead of their implementations. At least I've heard that it's better to just copy over the implementations from irrlicht source to your project and use those copies.newbie8787 wrote:If you're curious about the library being set up properly , the whole system was working fine , linking and all (along with displaying some static text on screen) until i decided to create my own version.
You could also try adding the CGUIStaticText file to your project. don't really know if that will help anything.
Yeah, you're probably right about this.what I mean is that he write the OnEvent method. no matters if it was implemented previously. Since when he write again the prototype in the header the linker expect it to be implemented again while he doesn't implemented it . So or he remove the prototype from the header or he just implement that again in the source file. If I'm correct there will not be compiling errors in this case but only linking errors.
Last edited by serengeor on Fri Mar 16, 2012 5:52 pm, edited 1 time in total.
Working on game: Marrbles (Currently stopped).
-
- Posts: 105
- Joined: Thu Jan 10, 2008 6:26 pm
Re: Liker error while trying to extend and recompile irrlich
Did that no avail ! In any case , as you can see from the sample of the linker errors i've given (there are 22) there are problems in linking almost all methods of the CGUIStaticText classREDDemon wrote:what I mean is that he write the OnEvent method. no matters if it was implemented previously. Since when he write again the prototype in the header the linker expect it to be implemented again while he doesn't implemented it . So or he remove the prototype from the header or he just implement that again in the source file. If I'm correct there will not be compiling errors in this case but only linking errors.
http://irrlicht.sourceforge.net/phpBB2/ ... 029#143029
-Game Link added download and play
-Game Link added download and play
-
- Posts: 105
- Joined: Thu Jan 10, 2008 6:26 pm
Re: Liker error while trying to extend and recompile irrlich
The problem with that approach is that I will have to implement *all* of the methods as indicated in the interface, I just need to override the onevent method , thats about the extent of my modifications.serengeor wrote: You should probably inherit only the interface classes instead of their implementations. At least I've heard that it's better to just copy over the implementations from irrlicht source to your project and use those copies.
http://irrlicht.sourceforge.net/phpBB2/ ... 029#143029
-Game Link added download and play
-Game Link added download and play
Re: Liker error while trying to extend and recompile irrlich
Pastebin is dead, but in short like serengeor said - you can only inherit from the interfaces in your applications. If you want a near identical class then copy it over, rename it(!) and add your changes then.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
-
- Posts: 105
- Joined: Thu Jan 10, 2008 6:26 pm
Re: Liker error while trying to extend and recompile irrlich
But what about all the classes that the implementation depends on ?
this : http://irrlicht.sourceforge.net/forum/v ... =9&t=45795 was my inspiration for doing this
this : http://irrlicht.sourceforge.net/forum/v ... =9&t=45795 was my inspiration for doing this
http://irrlicht.sourceforge.net/phpBB2/ ... 029#143029
-Game Link added download and play
-Game Link added download and play
Re: Liker error while trying to extend and recompile irrlich
You have to pass all classes you need to your class (as pointers). And yeah - your inspiration is doing it also wrong - or maybe he modified the engine itself. Might even work when it's static linked (not certain, but would make sense that it works then - still bad style).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
-
- Posts: 105
- Joined: Thu Jan 10, 2008 6:26 pm
Re: Liker error while trying to extend and recompile irrlich
So there is no cheap and quick way to just modify the OnEvent method of the Static text element and be done with it ? I shall have to copy all implementation details from the irrlicht source and only then can I create a custom response to events on the static text elements that I add to the gui. (is there any other , not so tedious and less time consuming way to do this ? )CuteAlien wrote:You have to pass all classes you need to your class (as pointers). And yeah - your inspiration is doing it also wrong - or maybe he modified the engine itself. Might even work when it's static linked (not certain, but would make sense that it works then - still bad style).
http://irrlicht.sourceforge.net/phpBB2/ ... 029#143029
-Game Link added download and play
-Game Link added download and play
Re: Liker error while trying to extend and recompile irrlich
Depends on what you really want to do. You can catch events for that element in your eventreceiver if that is what you need. There is no simply way to derive from an element, but then again copying the code and renaming the class would take me around 1 minute (+ maybe some time to get it compiling if it depends on other internal classes, that depends). So not really that big of a problem.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
-
- Posts: 105
- Joined: Thu Jan 10, 2008 6:26 pm
Re: Liker error while trying to extend and recompile irrlich
I'm trying to make a static text element that can be dragged around using the mouse and responds to one button press and the Static text element doesnt escalate any events to the event receiver, so I was trying to extend the definition to make a new onEvent method that propagates some events up the food chain and handle others internally.CuteAlien wrote:Depends on what you really want to do. You can catch events for that element in your eventreceiver if that is what you need. There is no simply way to derive from an element, but then again copying the code and renaming the class would take me around 1 minute (+ maybe some time to get it compiling if it depends on other internal classes, that depends). So not really that big of a problem.
http://irrlicht.sourceforge.net/phpBB2/ ... 029#143029
-Game Link added download and play
-Game Link added download and play