why did it fail to load the library at link at compilation time? i don't care about freeing the library yet it just won't work.
#include <windows.h>
int main()
{
LoadLibrary("winmm.lib");
timeGetTime();
}
.lib is not a dynamically linked library (DLL), and cannot be loaded at runtime. You need to load the .dll, or link the .lib at link time (at which point you don't use LoadLibrary).
Try this code. It should solve your problem.
#include <windows.h>
#pragma comment(lib, "winmm.lib")
int main()
{
DWORD time = timeGetTime();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With