Hello! I'm completely new to SFML, and I just installed it on Windows Subsystem for Linux (specifically Ubuntu) using the "sudo apt-get install libsfml-dev" command in my terminal. I created a very basic program (that was mostly copied from the SFML tutorials) to just test sound playback, and my program doesn't want to compile.
Here's my program:
#include <SFML/Audio.hpp>
int main() {
sf::Music music;
if (!music.openFromFile("coins.wav"))
return -1; // error
music.play();
}
and here's my terminal output:
root@ADAM-FLEX:/mnt/c/Users/nucle/Desktop/final project stuffz# g++ -g -Wall sfml.cpp -o test.exe
/tmp/ccrRq561.o: In function `main':
/mnt/c/Users/nucle/Desktop/final project stuffz/sfml.cpp:5: undefined reference to `sf::Music::Music()'
/mnt/c/Users/nucle/Desktop/final project stuffz/sfml.cpp:6: undefined reference to `sf::Music::openFromFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/mnt/c/Users/nucle/Desktop/final project stuffz/sfml.cpp:8: undefined reference to `sf::SoundStream::play()'
/mnt/c/Users/nucle/Desktop/final project stuffz/sfml.cpp:8: undefined reference to `sf::Music::~Music()'
/mnt/c/Users/nucle/Desktop/final project stuffz/sfml.cpp:5: undefined reference to `sf::Music::~Music()'
collect2: error: ld returned 1 exit statusI'm currently using Windows 10.
If anyone can give me any advice, it would be greatly appreciated!