Thread: PlaySound

  1. #16
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    Quote Originally Posted by Amarina View Post
    I PUT THE FOLLOWING CODE TO PLAY SOUNDS... BUT I GOT 1 ERROR... PLEASE HELP ME!!!

    Code:
    #include <windows.h>
    //#include <winmm.lib>
    #include <mmsystem.h>
    #include <conio.h>
    
    using namespace std ;
    
    int main()
    {
    PlaySound(TEXT("test.wav"), NULL, SND_ALIAS | SND_APPLICATION);
    return 0 ;
    }
    THIS IS THE ERROR!!!

    Compiler: Default compiler
    Building Makefile: "C:\Dev-Cpp\Makefile.win"
    Executing make...
    make.exe -f "C:\Dev-Cpp\Makefile.win" all
    g++.exe -c "sonidos 3.cpp" -o "sonidos 3.o" -nostdlib

    g++.exe "sonidos 3.o" -o "sonidos3.exe" -mwindows winmm.lib -lobjc -nostdlib

    g++.exe: winmm.lib: No such file or directory

    make.exe: *** [sonidos3.exe] Error 1

    Execution terminated



    PLEASE HELP ME!!!
    I think post #9 in this thread gives you the answer to your problem. You shouldn't bump old threads, and you should definitely read the old thread before bumping it.
    bit∙hub [bit-huhb] n. A source and destination for information.

  2. #17
    Webhead Spidey's Avatar
    Join Date
    Jul 2009
    Posts
    285
    Quote Originally Posted by cangel View Post
    Yes... I use visual studio 2005
    Make sure you are not creating a windows project. Create a console/empty project and your code will work.
    Spidey out!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. PlaySound doesn't play when called!
    By Queatrix in forum Windows Programming
    Replies: 7
    Last Post: 03-03-2006, 08:02 PM
  2. PlaySound error
    By Shadow12345 in forum Windows Programming
    Replies: 5
    Last Post: 10-02-2002, 07:10 AM
  3. PlaySound function & Console App
    By GaPe in forum Windows Programming
    Replies: 2
    Last Post: 06-26-2002, 12:25 PM
  4. about playsound()
    By Sekti in forum C++ Programming
    Replies: 0
    Last Post: 04-08-2002, 05:29 PM
  5. PlaySound();
    By tHaPuTeR in forum Windows Programming
    Replies: 2
    Last Post: 03-11-2002, 07:30 AM