Path: news.cs.au.dk!not-for-mail From: datpete@mjolner.dk Newsgroups: comp.lang.beta Subject: Re: snd.obj : error LNK2001: unresolved external symbol _sndPlaySound Date: 25 May 1999 09:16:13 -0000 Organization: Mjolner Informatics ApS Lines: 72 Approved: mailtonews@cs.au.dk Distribution: world Message-ID: <19990525091613.6559.qmail@noatun.mjolner.dk> Reply-To: datpete@mjolner.dk NNTP-Posting-Host: daimi.cs.au.dk X-Trace: xinwen.cs.au.dk 927623796 3727606 255.255.255.255 (25 May 1999 09:16:36 GMT) X-Complaints-To: news@cs.au.dk NNTP-Posting-Date: 25 May 1999 09:16:36 GMT Xref: news.cs.au.dk comp.lang.beta:11964 Sascha Kimmel writes: > > 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'; > .... > ---- /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 > Hi, as pointed out by Manmathan, there does not seem to be any need to include a C file with just #includes in However this is not the reason for the link error. Asuming that there actually is something in the snd.c file that you need to link onto your BETA program. Then the reason for the link error is that you beta program seems to be named snd.bet, and this program uses the snd.c C file. Both of these will result in nti\ms\snd.o being generated - one of them overwriting the other. The linker explains that nti\ms\snd.o appears twice in the link directive and later that it misses the contents of one of them (leading to unresolved symbols). Sincerely, Peter Andersen, Mjolner Informatics