1

I am making some project using SFML. I have downloaded library from their official site, using cmake I made VS10 project, compiled it and got all the libs and files I need. However, in my project I keep getting nonsense errors like

class "sf::SoundBuffer" has no member "LoadFromFile"

class "sf::Sound" has no member "SetBuffer"

even though I have checked in SoundBuffer header there is a function named LoadFromFile and in Sound there is a function called SetBuffer.

  SoundM::SoundM(void) 
  {
     buffer.LoadFromFile("ress/soundA.wav");
     collision.SetBuffer(buffer);
  }



   #ifndef SOUND_H
   #define SOUND_H

    enum Sounds {
PaddleCollision,
Losing
    };

     class SoundM {
     public:
SoundM(void);
void play(Sounds Sound);
    private:
sf::SoundBuffer buffer;
sf::Sound collision;
    };

    #endif 

What am I missing here?

3
  • Clean up code, please. And do not delete asked question this time. Commented Jul 5, 2012 at 14:10
  • Did you include the needed .h files? Commented Jul 5, 2012 at 14:29
  • Yes, I have. This is very strange behavior. Commented Jul 5, 2012 at 14:36

1 Answer 1

2

I assume that you are using the SFML version 2.0 RC. There was a name convention change and now, all function names start with a lowercase letter (camel case).

So you should try that.

buffer.loadFromFile("ress/soundA.wav");
collision.setBuffer(buffer);

Instead of that.

buffer.LoadFromFile("ress/soundA.wav");
collision.SetBuffer(buffer);

I hope that helps you!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.