Does this work (without that error)?
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
int main()
{
sf::SoundBuffer* pSb{};
sf::Sound* pSd{};
pSb = new sf::SoundBuffer{};
if (!pSb->loadFromFile("D:/resources/audio/music/Shiny Toy Guns - You Are The One.ogg"))
return EXIT_FAILURE;
pSd = new sf::Sound(*pSb);
pSd->play();
sf::RenderWindow window(sf::VideoMode({ 960u, 540u }), "");
while (window.isOpen())
{
while (const auto event{ window.pollEvent() })
{
if (event->is<sf::Event::Closed>())
window.close();
else if (const auto * keyPressed{ event->getIf<sf::Event::KeyPressed>() })
{
switch (keyPressed->code)
{
case sf::Keyboard::Key::Escape:
window.close();
break;
}
}
}
window.clear();
//window.draw();
window.display();
}
}
It's based on your code and seems to be what it does.
Obviously, you'd need to insert a filename that is valid for you
