Jump to content
  • Advertisement
Sign in to follow this  
danielgamedev

timeGetTime() linking to winmm???

This topic is 4885 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi guys I'm a noobie, I want to time a compute function using the Maya API. I decided on using timeGetTime() because there is alot of info out there. I'm using Microsoft Visual Studio.NET 2003 My code looks like this: #include <time.h> #include <stdlib.h> #include <stdio.h> #include <windows.h> #include <mmsystem.h> MStatus mayaNode::compute ( blah blah) { timeBeginPeriod(1); DWORD start, finish, duration; start = timeGetTime(); BLAH blah...many loops and functions..blah blah finsh = timeGetTime(); duration = finish - start; cout << DURATION << duration <<endl; timeEndPeriod(1); } I get three error message for timeBeginPeriod, timeEndPeriod and timeGetTime when I try to compile: error LNK2019: unresolved external symbol __imo_timeBeginPeriod@4 referenced in function "public: virtual class MStatus__thiscall mayaNode::compute( blah blah)" One possible solution is that I have to link to the winmm lib but I don't know how to do this. Please help, dgd

Share this post


Link to post
Share on other sites
Advertisement
danielgamedev,

You can add the library via right clicking on the project then going to properties, click on the linker options, and under input add the winmm.lib file to the list of dependencies. Another way is #pragma comment (lib, "winmm.lib")

-brad

Share this post


Link to post
Share on other sites
Quote:
Original post by Galapaegos
danielgamedev,

You can add the library via right clicking on the project then going to properties, click on the linker options, and under input add the winmm.lib file to the list of dependencies. Another way is #pragma comment (lib, "winmm.lib")

-brad


Thank you Brad. It worked like magic.

d

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!