-
mciSendString
Hello,
I use the API mciSendString to play a song, but each time I got this error:
MCISendString.obj : error LNK2001: unresolved external symbol __imp__mciSendStringA@16
Here the code I use:
PHP Code:
mciSendString("open c:\\test.wav type waveaudio alias test", 0, 0, NULL);
mciSendString("play test from 0", 0, 0, NULL);
Why am I getting this error? Anyone can help.
-
Check your included libraries in your project. Make sure,
Winmm.lib
is also there.
-
You are right, I thought we only had to include the windows.h to use any API call.
-
windows.h is sufficient to tell the COMPILER what functions are used.
However, the linker, when it resolves all the names, uses the .lib files to work out where to get the program code from, or what DLL the function resides in. This is where it cannot find the name from, until you tell it to also search in winmm.lib :)