Pelles C forum

C language => Beginner questions => Topic started by: Shiyin on December 27, 2008, 01:58:46 AM

Title: How to beep?
Post by: Shiyin on December 27, 2008, 01:58:46 AM
Hi. I want to cause the computer speaker to beep in Pelles C as is possible in MS VC++ with Beep(frequency in Hz, duration in milliseconds); under <windows.h>. I've tried this & other methods from the web but in Pelles C long lists of error messages appear.

If there are any other comparably simple ways to make a sound which can be specified in pitch & duration, please post it.

Thanks.
Title: Re: How to beep?
Post by: Robert on December 27, 2008, 07:35:47 AM
From the FAQ

http://forum.pellesc.de/index.php?board=10.0

By default, the compiler only accepts standard C. To compile a Windows program, you need to enable Microsoft extensions in the compiler. In the IDE, go to Project Options and make sure Enable Microsoft Extensions is checked on the Compiler tab. From the command line, make sure you use the /Ze compiler option.

Robert Wishlaw
Title: Re: How to beep?
Post by: Shiyin on December 28, 2008, 12:37:33 PM
Thanks Robert. I finally have my program beeping now.

Shiyin.