From: "Damian Yerrick" Newsgroups: comp.os.msdos.djgpp References: <386FBA6E DOT CFA57AE8 AT pepparkakor DOT demon DOT nl> Subject: Re: What is wrong? Lines: 59 Organization: Pin Eight Software X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Message-ID: X-Trace: +4vTA3Iux8kKXvtC2hCuk9eHXtOrobkBqX4pWcZNwwMW7VVgCvIoMkTYDOy2+tKU09mHRkqxlTXV!shwX6hvMDFyfIKg1JafpgJDey06lHXDSZvIGSCXeUzTjbUrqa6rLpDQDzOo3okdLcGZN8i6f0g== X-Complaints-To: abuse AT gte DOT net X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly NNTP-Posting-Date: Sun, 02 Jan 2000 22:42:57 GMT Distribution: world Date: Sun, 02 Jan 2000 22:42:57 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Roger" wrote: > > When I try this little program,my computer make a reboot,and that is not > what I like,so please,what is wrong? > > #include > #include > #include > > #include "allegro.h" If you installed Allegro properly (make install), allegro.h should be in your standard C include folder. #include > SAMPLE *det; > > int main() { > allegro_init(); > install_timer(); > install_sound(DIGI_AUTODETECT,MIDI_AUTODETECT,0); On a few computers, Allegro 3.12's install_sound() crashed on me when it was trying to guess the chipset. Try running Allegro Setup first. > det=load_wav("applouse.wave"); Are you checking if(det == NULL)? If you misspell the file name, it won't load the wave, and you'll get a NULL pointer. > play_sample(det,255,127,9000,-1); And if you try to play a NULL pointer under Windows 9x, unpredictable results may occur. (Under straight DOS with CWSDPMI, it's predictable that your program will segfault gracefully.) > } -- Damian Yerrick http://yerricde.tripod.com/ View full .sig: http://www.rose-hulman.edu/~yerricde/sig.html and now you must pay...