so Im quite new to c++ and I struggle to find an answer to my problem. Im using VS Code and I would like to know a way to create a resource from wav file and play it using PlaySound. I have no idea how to adress a resource.
I tried making header file defining IDR_SOUND 1 and including it in .rc file but when compiling it with g++ it just gives me an error: "error: ld returned 1 exit status"
#include "resource.h"
IDR_SOUND WAVE "C:\Users\super\sound.wav"
My code looks like this:
#include <windows.h>
#include "resource.h"
#pragma comment(lib, "winm.lib")
int main()
{
PlaySound(MAKEINTRESOURCE(IDR_SOUND), GetModuleHandle(NULL), SND_RESOURCE);
std::cin.get();
}
I would be really thankful for any explanation how to do it properly