Playing wave file, error - can't understand

This is a discussion on Playing wave file, error - can't understand within the Windows Programming forums, part of the Platform Specific Boards category; When i add any of following functions PlaySound("fileName", 0, 0); or PlaySound("Type.wav", 0, SND_FILENAME); or sndPlaySound("fileName",SND_SYNC); i get error LNK2001: ...

  1. #1
    R
    Guest

    Unhappy Playing wave file, error - can't understand

    When i add any of following functions

    PlaySound("fileName", 0, 0);

    or

    PlaySound("Type.wav", 0, SND_FILENAME);

    or

    sndPlaySound("fileName",SND_SYNC);


    i get

    error LNK2001: unresolved external symbol __imp__sndPlaySoundA@8
    Debug/sd.exe : fatal error LNK1120: 1 unresolved externals

    And i can't make any sense of it. please help me out?

    just want' to play wav files.

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    164
    Did you link it together with winmm.lib and included 'mmsystem.h'?
    // Gliptic

  3. #3
    R
    Guest
    how would i check if

    winmm.lib

    is being used.

    But i am including 'mmsystem.h'?

  4. #4
    Registered User
    Join Date
    Sep 2001
    Posts
    164
    I don't know which compiler you are using but you have to link winmm.lib to the exe-file.
    // Gliptic

  5. #5
    R
    Guest
    Visual C++ 6 on 98.

    how would i link winmm.lib.

  6. #6
    Unregistered
    Guest

    Thumbs up

    Project ---> Settings ---> The "Link" tab ---> In the "Project
    "Options" textbox type in: winmm.lib

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. File transfer- the file sometimes not full transferred
    By shu_fei86 in forum C# Programming
    Replies: 13
    Last Post: 03-13-2009, 01:44 PM
  2. sequential file program
    By needhelpbad in forum C Programming
    Replies: 80
    Last Post: 06-08-2008, 02:04 PM
  3. Inventory records
    By jsbeckton in forum C Programming
    Replies: 23
    Last Post: 06-28-2007, 05:14 AM
  4. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 02:53 AM
  5. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 10:54 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21