rodro rodro - 1 year ago 71
C++ Question

Using mmsystem.h in VisualStudio 2008

I'm trying do create a 64bit dll which sets a global hook. As I read it can't be done with CLR (I even tried), so I created a Win32 project and I will build it for 64bit platform.
Will it work this way?

My main question is how to use mmsystem.h in this project. I need to use multimedia timer and when I use timeBeginPeriod or timeSetEvent I have a linker error:


1>dll64.obj : error LNK2019: unresolved external symbol [email protected] referenced in function [email protected]

1>dll64.obj : error LNK2019: unresolved external symbol [email protected] referenced in function [email protected]


How to fix this?

Answer Source

You have to link with winmm.lib, it isn't one of the default libraries that gets linked. A simple way is to put the link instruction in your source code:

#include <windows.h>
#include <mmsystem.h>
#pragma comment(lib, "winmm.lib")
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download