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

Author Topic: SoundBuffer error "Incomplete type not allowed"  (Read 8773 times)

0 Members and 1 Guest are viewing this topic.

Tristanbox09

  • Newbie
  • *
  • Posts: 5
    • View Profile
SoundBuffer error "Incomplete type not allowed"
« on: December 10, 2020, 03:28:39 am »
Hello guys,

I am trying to load a losing sound for minesweeper, and I achieved this in the main window first. I then moved my function to a class and I am getting an incomplete type not allowed on my buffer object. Any ideas? My code is below:

void Board::losingSound(sf::SoundBuffer& buffer, sf::Sound& sound)
{
   buffer.loadFromFile("sound/gameover.wav");


   sound.setBuffer(buffer);

   sound.play();

   soundOff = true;
}

Stauricus

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
    • A Mafia Graphic Novel
    • Email
Re: SoundBuffer error "Incomplete type not allowed"
« Reply #1 on: December 10, 2020, 04:50:27 am »
what is soundOff?
Visit my game site (and hopefully help funding it? )
Website | IndieDB

Kvaz1r

  • Newbie
  • *
  • Posts: 39
    • View Profile
    • Email
Re: SoundBuffer error "Incomplete type not allowed"
« Reply #2 on: December 10, 2020, 09:03:52 am »
Did you also move line
#include <SFML/Audio.hpp>
into your header?