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.
Post Reply
Rocko Bonaparte
Posts: 48
Joined: Tue Aug 31, 2010 6:27 am

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

Post by Rocko Bonaparte »

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?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

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

Post by CuteAlien »

That function is not exported. Use an ITimer pointer instead and pass that to your editbox.
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
Rocko Bonaparte
Posts: 48
Joined: Tue Aug 31, 2010 6:27 am

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

Post by Rocko Bonaparte »

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?
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

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

Post by hendu »

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 ;)
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

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

Post by CuteAlien »

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.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Rocko Bonaparte
Posts: 48
Joined: Tue Aug 31, 2010 6:27 am

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

Post by Rocko Bonaparte »

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.
Post Reply