PlaySound

This is a discussion on PlaySound within the C++ Programming forums, part of the General Programming Boards category; Originally Posted by Amarina I PUT THE FOLLOWING CODE TO PLAY SOUNDS... BUT I GOT 1 ERROR... PLEASE HELP ME!!! ...

  1. #16
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,265
    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!

Page 2 of 2 FirstFirst 12
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, 08:10 AM
  3. PlaySound function & Console App
    By GaPe in forum Windows Programming
    Replies: 2
    Last Post: 06-26-2002, 01:25 PM
  4. about playsound()
    By Sekti in forum C++ Programming
    Replies: 0
    Last Post: 04-08-2002, 06:29 PM
  5. PlaySound();
    By tHaPuTeR in forum Windows Programming
    Replies: 2
    Last Post: 03-11-2002, 07:30 AM

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