SFML community forums
Help => Audio => Topic started by: og_the_trog on January 27, 2014, 02:55:22 am
-
Hello Everyone
I only started using the sfml audio module today, and when I try to define a sound and compile my code, visual studio gives me an error saying "error C2039: 'Sound' : is not a member of 'sf'"
normally on vc++ it underlines a word in red if it has found an error, but with this it only gives me an error when I compile.
I have included SFML/Audio.hpp, but indirectly, meaning I'm including a header file that's including SFML/Audio.hpp. If that means anything.
I've also added sfml-audio-d.lib as an additional dependency, in the linker properties.
another curious thing is when I try to run the example programs for sound and sound capture a window pops up saying "the program can't start because openal32 dll is missing from your computer"
perhaps that's the reason, if it is I have no idea how to fix it...
I'm using sfml 2.0, on windows 7 home premium, and compiling on microsoft visual c++ 2010 express edition
ThankYou c:
-
Strange, I managed to fix it, but I don't know why it had this problem to start with.
first time I defined my sf::sound in the header file, this gave me the "'Sound' : is not a member of 'sf'" error.
but when I define it in the .cpp file it works fine and as expected.
oh well I'll just have to put up with it, atleast I managed to fix it at all.
-
Are you sure you were including <SFML/Audio.hpp> in your header file?
-
Don't trust IntelliSense, it has many issues, starting at hanging itself up and ending at marking random things.
The only thing you should fully trust is the compiler and linker.
If a class declaration can't be found, then you haven't included the right header at the right position. Since it didn't work in your header, you most likely forgot to include SFML/Audio.hpp.