I am trying to play a .wav file but it won't work. I have got the correct dependencies and links etc setup, however for my code it says "The program can't start because OpenAL32.dll is missing from your computer". However it
IS in my linker settings, and I can see it in the SFML files. So why isn't it being found? My code:
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <SFML/Audio.hpp>
int main()
{
sf::Window window(sf::VideoMode(800, 600), "My window");
// run the program as long as the window is open
while (window.isOpen())
{
sf::SoundBuffer buffer;
buffer.loadFromFile("WhatCan.wav");
// load something into the sound buffer...
sf::Sound sound;
sound.setBuffer(buffer);
sound.play();
// check all the window's events that were triggered since the last iteration of the loop
sf::Event event;
while (window.pollEvent(event))
{
// "close requested" event: we close the window
if (event.type == sf::Event::Closed)
window.close();
}
}
return 0;
}