0

Hi,
I have a problem because :

this is my code

#include <iostream>  
#include <windows.h>   // Sleep() 
#include <mmsystem.h>  // mciSendString()

using namespace std;   // std::cout, std::cin

int main()  
{  
  mciSendString("open CDAudio", NULL, 0, NULL);
  Beep(440,1000);   
  cout << "Opening CD-ROM door ..." << endl;  
  mciSendString("set CDAudio door open", NULL, 0, NULL);  

  cout << "Closing the CD-ROM door in 5 seconds ..." << endl;  
  Sleep(5000);  
  mciSendString("set CDAudio door closed", NULL, 0, NULL);  

  mciSendString("close CDAudio", NULL, 0, NULL);

  cin.get();  // wait  
  return 0;  
}

and the error is :

C:\Documents and Settings\user\Pulpit\Makefile.win [Build Error] exe: *** [Output/MingW/Projekt1.exe] Error 1

please help me

2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by TheBeast32
0

It compiles fine with Code::Blocks and MinGW. You have to link with libwinmm.a if you have MinGW or winmm.lib for anything else.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.