SFML community forums

Help => Audio => Topic started by: BaneTrapper on November 30, 2012, 06:52:13 pm

Title: Just by declaring sf::Music application returns error
Post by: BaneTrapper on November 30, 2012, 06:52:13 pm
Hello.
Am doing this
int main()
{
    sf::Music audio;
    return 0;
}
Process returned -2147418113 <0x8000FFFF> execution time : 0.100s
Press any key to continue.

I had huge program and was commenting out peace by peace until i stumbled on this.
Why is declaring sf::Music giving me error ? i also tried downloading latest snapshot build and also build my own with cmake and MinGW for codeblocks and am still getting this error, why is that?
Also what can i do to fix this?

Am coming from a post on gamedev.net if you need more info
Quote
http://www.gamedev.net/topic/635055-sfml-application-on-exit-dosent-return-0/

EDIT::
I just tried reproducing error with VisualStudio2010 Express and i was unable.
The error occurs with CodeBlocks10.05 using GCC/MinGW.
Any tips how to fix it on codeblocks?
Title: Re: Just by declaring sf::Music application returns error
Post by: gyscos on November 30, 2012, 07:22:23 pm
Maybe you're dynamically linking and it doesn't find the dll ? Maybe the IDEs don't start the executable from the same directory...
Title: Re: Just by declaring sf::Music application returns error
Post by: FRex on November 30, 2012, 07:36:56 pm
Might be related to issue https://github.com/SFML/SFML/issues/30
This audio bug is really fishy, esecially that old openal32.dll fixes it..
Title: Re: Just by declaring sf::Music application returns error
Post by: BaneTrapper on November 30, 2012, 07:40:49 pm
I have a big application(game)
It runs as expected. But when i shut it down and code comes to being destroyed i get this error
Quote
At C:\C++\HeroesPath\main.cpp:18
Continuing...
Program received signal SIGSEGV, Segmentation fault.
In ?? () (C:\Windows\system32\nvoglv32.dll)
Its after return at closing brackets,
Tracing the error i fount out it is from declaring a sf::Music object.
The problem does not occur when using Visual studio 2010

As for linking it dynamically, yes i am linking it this way.
It does not give me error that .dll couldnt be found.

Might be related to issue https://github.com/SFML/SFML/issues/30
This audio bug is really fishy, esecially that old openal32.dll fixes it..
Ok il check it up, thanks. The search on forum is not working for me :(
Title: AW: Re: Just by declaring sf::Music application returns error
Post by: eXpl0it3r on November 30, 2012, 08:19:52 pm
The search on forum is not working for me :(
Only select the forums which are releated to your problem (i.e. all the bindings are most probably not needed.)
Title: Re: Just by declaring sf::Music application returns error
Post by: BaneTrapper on November 30, 2012, 08:24:07 pm
Downloading a random OpenAL32.dll and replacing the one from sfml fixed the error.
But now my application takes about 10-15 seconds to start...

Thanks FRex on pointing me!
Title: Re: Just by declaring sf::Music application returns error
Post by: FRex on November 30, 2012, 09:12:35 pm
Quote
But now my application takes about 10-15 seconds to start...
If you load .ogg it's probably because you have latest sfml:
https://github.com/SFML/SFML/issues/310
Title: Re: Just by declaring sf::Music application returns error
Post by: Laurent on November 30, 2012, 09:18:27 pm
Don't use a random openal32.dll, use OpenAL Soft 1.14 (it's explicitely mentionned in the task tracker).
Title: Re: Just by declaring sf::Music application returns error
Post by: BaneTrapper on December 01, 2012, 01:11:28 am
Don't use a random openal32.dll, use OpenAL Soft 1.14 (it's explicitely mentionned in the task tracker).
Well i didn't really find much info how to get it from web.
But it  said just rename soft_oal.dll to OpenAL32.dll in readme. And it seems to work as good as last one.
Tho application still takes 10 sec to open...
Title: Re: Just by declaring sf::Music application returns error
Post by: Laurent on December 01, 2012, 08:51:40 am
Quote
Well i didn't really find much info how to get it from web
Google: "openal soft" -> first link -> "Download section" -> "A Win32 binary is also provided" -> the link is right below. Replace the openal32.dll file. It works.
Title: Re: Just by declaring sf::Music application returns error
Post by: BaneTrapper on December 01, 2012, 06:33:00 pm
That's exactly what i did.
Only thing is that i cant find OpenAL32.dll i just see soft_oal.dll which they say to rename to OpenAL32.dll and use it.
Whats what i replayed last time :P.
Thanks on time and good help, with good fortune.