Unresolved external for irr::os::Timer::getTime()

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.

Unresolved external for irr::os::Timer::getTime()

Postby Rocko Bonaparte » Sat Jun 16, 2012 7:56 pm

I ripped out the Irrlicht text box source into my own project to modify into something like a script console (see advanced forum). It was mostly building fine, except the timing code for the cursor:

1>CustomEditBox.obj : error LNK2019: unresolved external symbol "public: static unsigned int __cdecl irr::os::Timer::getTime(void)" (?getTime@Timer@os@irr@@SAIXZ) referenced in function "protected: bool __thiscall irr::gui::CustomEditBox::processKey(struct irr::SEvent const &)" (?processKey@CustomEditBox@gui@irr@@IAE_NABUSEvent@3@@Z)


It's using a lot of other Irrlicht goodies in there without a problem. I just blocked off the timer code so the cursor doesn't blink at all for now. I can build and run that way. That is what makes this really peculiar to me.

I'm running with Visual Studio 2010 SP1, with a build I made of it by porting from the Irrlicht9.0 project. I don't see any defines blocking compilation of getTime() in os.cpp. Any ideas what could have gone wrong in this case?
Rocko Bonaparte
 
Posts: 48
Joined: Tue Aug 31, 2010 6:27 am

Re: Unresolved external for irr::os::Timer::getTime()

Postby CuteAlien » Sun Jun 17, 2012 9:12 am

That function is not exported. Use an ITimer pointer instead and pass that to your editbox.
IRC: #irrlicht on irc.freenode.net
My patches&stuff: http://www.michaelzeilfelder.de/irrlicht.htm
Games with Irrlicht: http://www.irrgheist.com/
News: http://www.reddit.com/r/irrlicht/
User avatar
CuteAlien
Admin
 
Posts: 5364
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany

Re: Unresolved external for irr::os::Timer::getTime()

Postby Rocko Bonaparte » Sun Jun 17, 2012 9:56 pm

CuteAlien wrote:That function is not exported. Use an ITimer pointer instead and pass that to your editbox.


This kind of blows my mind. How does one make that kind of thing happen?
Rocko Bonaparte
 
Posts: 48
Joined: Tue Aug 31, 2010 6:27 am

Re: Unresolved external for irr::os::Timer::getTime()

Postby hendu » Mon Jun 18, 2012 8:17 am

Huh? You're using internal code, which is using internal methods, and expecting them to be exported?

That happens because not all interfaces should be public, ya know ;)
hendu
 
Posts: 1557
Joined: Sat Dec 18, 2010 12:53 pm

Re: Unresolved external for irr::os::Timer::getTime()

Postby CuteAlien » Mon Jun 18, 2012 10:08 am

Funny enough Irrlicht exports nearly no function beside createDevice. You include Irrlicht headers - so everything in the header is obviously also in your code (that's how your compiler knows about all the interface classes), but aside from the createDeviceFunctions (nearly) none of the functions can be used at link-time. If you want to see how export is done look at the header and source of createDevice (and then search for the macro used there).

But in your case - just add an ITimer pointer in your custom editbox and make sure to pass it on creation.
IRC: #irrlicht on irc.freenode.net
My patches&stuff: http://www.michaelzeilfelder.de/irrlicht.htm
Games with Irrlicht: http://www.irrgheist.com/
News: http://www.reddit.com/r/irrlicht/
User avatar
CuteAlien
Admin
 
Posts: 5364
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany

Re: Unresolved external for irr::os::Timer::getTime()

Postby Rocko Bonaparte » Mon Jun 18, 2012 5:06 pm

Yeah I switched the code over to using an ITimer*. That gave me back the wonderful, blinking cursor. So lesson learned in co-opted Irrlicht source code.
Rocko Bonaparte
 
Posts: 48
Joined: Tue Aug 31, 2010 6:27 am


Return to Beginners Help

Who is online

Users browsing this forum: No registered users and 1 guest