Path: news.cs.au.dk!not-for-mail From: Flemming Gram Christensen Newsgroups: comp.lang.beta Subject: Re: snd.obj : error LNK2001: unresolved external symbol _sndPlaySound Date: Tue, 25 May 1999 14:42:36 +0200 Organization: University of Aarhus, Department of Computer Science (DAIMI) Lines: 135 Message-ID: <374A9ABC.75C4@mjolner.dk> References: <19990524092842.25226.qmail@noatun.mjolner.dk> NNTP-Posting-Host: odin.mjolner.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: xinwen.cs.au.dk 927636157 3725200 255.255.255.255 (25 May 1999 12:42:37 GMT) X-Complaints-To: news@cs.au.dk NNTP-Posting-Date: 25 May 1999 12:42:37 GMT X-Mailer: Mozilla 3.01 (X11; I; SunOS 5.6 sun4m) Xref: news.cs.au.dk comp.lang.beta:11965 Sascha Kimmel wrote: > > Hello! > > I'm trying to use the MS WINAPI function sndPlaySound > (http://msdn.microsoft.com/library/sdkdoc/multimed/mmfunc_4uzo.htm) from > within BETA. > The program looks as follows: > > ---- cut here ---- > > ORIGIN '~beta/guienv/v1.6/guienvall'; > > INCLUDE '~beta/guienv/v1.6/private/winnt/guienv_ntiprivate' > '~beta/guienv/v1.6/private/winnt/stddialogs_ntibody' > '~beta/win32lib/v1.6/ntinterface' > '~beta/win32lib/v1.6/winuserconsts'; > > BUILD nti '$$/snd.obj' 'snd.c' 'betacc $0 $1'; > > -- program: descriptor -- > > guienv > (# > > SND_ASYNC:(# exit 0x0001 #); > > PlaySound: external > (# > pszSound:[1]@char; (* LPCSTR *) > fdwSound:@integer; (* DWORD *) > result:@integer; > enter (pszSound,fdwsound) > do 'sndPlaySound' -> callStd; > exit result > #); > > do > ('gleitab.wav',SND_ASYNC)->PlaySound; > > #) Hi The playSound is really a macro. Thats is a problem I used the following code once: sound.bet: ORIGIN '~beta/basiclib/v1.6/betaenv'; LINKOPT nti_ms 'winmm.lib' nti_gnu '-lwinmm'; -- lib:attributes --- SND_SYNC: (# exit 0x0000 #); (* play synchronously (default) *) SND_ASYNC: (# exit 0x0001 #); (* play asynchronously *) SND_NODEFAULT:(# exit 0x0002 #); (* silence (!default) if sound not found *) SND_MEMORY: (# exit 0x0004 #); (* pszSound points to a memory file *) SND_LOOP: (# exit 0x0008 #); (* loop the sound until next sndPlaySound *) SND_NOSTOP: (# exit 0x0010 #); (* do not stop any currently playing sound *) PlaySound:external (# name:[0]@char; hmod:@integer; fdwsound:@integer; result:@integer; enter (name,hmod,fdwsound) do 'PlaySoundA'->CallStd; exit result #); tstsound.bet: ORIGIN 'sound'; --program:Descriptor-- (# do ('Maximize',0,SND_ASYNC %Bor SND_LOOP)->playsound; getline; ('',0,0)->playsound; getline; #) This plays the sound the user has associated with the windows action "maximizing-a-window", it playes it asyncron, and in a loop. PlaySoundA is the 8-bit edition. PlaySoundW takes WCHAR's as parameter. Playsound expands either to playsoundA or PlaysoundW. /gram > > ---- /cut here ---- > > I'm using snd.c just for including the necessary mmsystem.h: > > ---- cut here ---- > > #include > #include > #include > #include > #include > > ---- /cut here ---- > > When I try to compile this program I get the following error message: > > d:\beta\tricos\nti\ms\snd.obj : warning LNK4042: object specified more > than once > ; extras ignored > snd.obj : error LNK2001: unresolved external symbol _sndPlaySound > snd.exe : fatal error LNK1120: 1 unresolved externals > A Link Error Occurred > > Any quick help is appreciated!! > > Regards, > Sascha Kimmel > kimmel@tricos.com -- /Flemming Gram Christensen ------------------------------------------------------------------------ Mjolner Informatics ApS Phone: +45 86 20 20 00 Science Park Aarhus Fax: +45 86 20 12 22 Gustav Wieds Vej 10 DK-8000 Aarhus C Denmark E-mail: gram@mjolner.dk ------------------------------------------------------------------------