Hi! I've tried to use the SFML/Audio class. But when I create an object for example:
sf::Music mus;
mus.openFromFile("music.wav");
mus.play();
And try to use it. It gives me undefined reference. Even to the constructor?!
Well, this is the full code if it is anything wrong with it:
#include <iostream>
#include "SFML/Window.hpp"
#include "SFML/Graphics.hpp"
#include "SFML/Audio.hpp"
using namespace std;
int main()
{
sf::RenderWindow window(sf::VideoMode(640, 480), "Window");
sf::Event event;
sf::Music mus;
mus.openFromFile("music.wav");
mus.play();
while (window.isOpen())
{
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
{
window.close();
}
}
window.clear(sf::Color::Black);
window.display();
}
return 0;
}
Isn't it enough with just including these lines?:
#include "SFML/Window.hpp"
#include "SFML/Graphics.hpp"
#include "SFML/Audio.hpp"
Or do I have to include even more directiories?
The bunch of errors I'm getting is undefined reference
to everything. This is how it looks like:
EDITED:
Couldn't get an image of it to the forum