Results 1 to 4 of 4

Thread: mciSendString

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2001
    Location
    Québec, Canada
    Posts
    131

    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"00NULL);
    mciSendString("play test from 0"00NULL); 
    Why am I getting this error? Anyone can help.
    Khavoerm Irithyl

  2. #2
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    Check your included libraries in your project. Make sure,

    Winmm.lib

    is also there.
    Baaaaaaaaah

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2001
    Location
    Québec, Canada
    Posts
    131
    You are right, I thought we only had to include the windows.h to use any API call.
    Khavoerm Irithyl

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width