It seems like you're not  passing -lwinmm to the linker. I use this:
LDFLAGS := -Wl,--as-needed -lgdi32 -lcomdlg32 -lws2_32 -lwinmm
 -Wl,--no-as-needed

to selectively link these libraries. I'm not sure if the "as-needed" logic
is required on windows, but it works for me™.

What it does is only reference these libraries as a dependency if your
program needs symbols for them).

Em seg, 29 de jun de 2015 às 20:53, <[email protected]> escreveu:

>   The latest MinGW64 complains about this code:
> *#include <windows.h>*
> *#include <mmsystem.h>*
> *#include <Mmsystem.h>*
>
> *bool abc::Sound::PlayIt(){*
> *    //return !!sndPlaySoundW(Soundfile.c_str(), SND_FILENAME);*
> *    return !!PlaySoundW(Soundfile.c_str(), NULL,
> SND_FILENAME/*SND_ASYNC*/);*
> *}*
>
> It says
> *In function `abc::Sound::PlayIt()':*
> *C:/Win32/sound.cpp:28: undefined reference to `__imp_PlaySoundW'*
>
> This code compiles under VS, it should under g++ 5.1.
>
>
> ------------------------------
>   [image: Avast logo] <http://www.avast.com/>
>
> This email has been checked for viruses by Avast antivirus software.
> www.avast.com
>
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
> _______________________________________________
> Mingw-w64-public mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to