timeGetTime() linking to winmm???
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
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
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement