News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Undefined symbol for playsound

Started by Magnum, April 05, 2010, 09:43:57 PM

Previous topic - Next topic

Magnum

This returns with undefined symbol for PlaySound.

invoke PlaySound, addr sound, NULL, SND_FILENAME);

invoke ExitProcess,0

Have a great day,
                         Andy

oex

include \masm32\include\winmm.inc
includelib \masm32\lib\winmm.lib
We are all of us insane, just to varying degrees and intelligently balanced through networking

http://www.hereford.tv

dedndave

the parenthesis and semicolon ");" look like C leftovers - maybe that is the undefined symbol

Magnum

Quote from: dedndave on April 05, 2010, 11:13:16 PM
the parenthesis and semicolon ");" look like C leftovers - maybe that is the undefined symbol

You are right, the parenthesis didn't belong. But the missing include and library had to be there.

Most API's have info on necessary includes, but PlaySound didn't.
PlaySound wasn't even in the 2003 SDK help files.


Have a great day,
                         Andy

hutch--

Magnum, see if you can find the reference material on MSDN online.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

MichaelW

My 2003 PSDK documents it, and includes the necessary header file and import library.
eschew obfuscation

donkey

oex has it right, it is exported by winmm.dll so the lib should be winmm.lib. However, it is available in both ANSI and UNICODE versions so you may have to use PlaySoundA or PlaySoundW if it is not redirected by your include file or you can do the redefinition yourself

PlaySound equ <PlaySoundA>
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

Farabi

anyway for the SND_MEMORY what is the image format?
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"

Magnum

Quote from: MichaelW on April 07, 2010, 03:28:43 AM
My 2003 PSDK documents it, and includes the necessary header file and import library.

My mistake.
I was looking in the Functions by Alphabetical Order which doesn't list everything.

I found PlaySound in my SDK.

Have a great day,
                         Andy