Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - pppizzacat

Pages: [1]
1
General / Re: C++ code not compiling.
« on: August 12, 2020, 10:41:53 am »
I tried compiling in the way shown in the tutorial and linking the library, but now I'm getting this in my console whenever I execute my program.

An internal OpenAL call failed in SoundStream.cpp(472).
Expression:
   alSourceUnqueueBuffers(m_source, 1, &buffer)
Error description:
   AL_INVALID_OPERATION
   The specified operation is not allowed in the current state.


This just repeats over and over.

2
General / C++ code not compiling.
« on: August 12, 2020, 07:01:21 am »
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 status


I'm currently using Windows 10.
If anyone can give me any advice, it would be greatly appreciated!

Pages: [1]