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

Author Topic: [Resolved]SoundBuffer crashing program?  (Read 4391 times)

0 Members and 1 Guest are viewing this topic.

Ditto

  • Newbie
  • *
  • Posts: 17
    • View Profile
    • Email
[Resolved]SoundBuffer crashing program?
« on: September 21, 2013, 11:45:15 am »
I'm pretty new to SFML but I get everything graphically to work really well. When trying to load a soundbuffer (loadFromFile()) the game crashes before even getting to the code. I tried setting breakpoints on the lines that load sound but that doesn't work at all.

All I get is an Application Error window saying: "The application was unable to start correctly (0xc000007b). Click OK to close the application". I tried searching and found someone saying I should update my C++ redist(http://forums.autodesk.com/t5/DWG-TrueView/The-application-was-unable-to-start-correctly-0xc000007b/td-p/3477858), but that is already up to date!

Anyone had problem with the SoundBuffer like this?
« Last Edit: September 23, 2013, 07:16:33 pm by Ditto »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10830
    • View Profile
    • development blog
    • Email
AW: SoundBuffer crashing program?
« Reply #1 on: September 21, 2013, 01:00:29 pm »
Seems like you aren't running the application through a debugger, otherwise the execution would automatically stop and jump to the code with the issue.
Given that loadFromFile uses strings and the runtime lib doesn't like it when you use multiple versions, I'd say you're mixing debug and release modes.

Btw what OS/compiler?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Ditto

  • Newbie
  • *
  • Posts: 17
    • View Profile
    • Email
Re: SoundBuffer crashing program?
« Reply #2 on: September 21, 2013, 01:58:22 pm »
I'm using VS2010 ultimate. Problem occurs in both debug and release mode! Breakpoints etc work fine until I add buffer.loadFromFile(); ..

Ditto

  • Newbie
  • *
  • Posts: 17
    • View Profile
    • Email
Re: [Resolved]SoundBuffer crashing program?
« Reply #3 on: September 23, 2013, 07:19:17 pm »
I got it working now! The problem was with the DLL files not being in the right folder. Specifically the DLL files found in "bin" in the SFML-2.1 folder. put them in my project folder and it now works like a charm.

All this linking is new to me and it's really confusing/frustrating  :-[ Thanks for the help anyways  :D

pinko64

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: [Resolved]SoundBuffer crashing program?
« Reply #4 on: January 30, 2014, 12:59:26 am »
I'm suffering the same problem currently.
In the following example:
int main()
{

    std::cout << "gooo";
    sf::SoundBuffer bf;

}
 
The program terminates with 0xc000007b message. Even before executing the std::cout function.
However my dll's should be on the correct directory.

I suppose it has something to do with that openal32.dll?
I built my sfml with tdm64. Can that be a problem?



Okay... i copied both openal32.dll and libsndfile-1.dll from githubs x64 bin directory and it didn't crash.
Weird that the ones that came when i built sfml didn't work.
« Last Edit: January 30, 2014, 01:03:56 am by pinko64 »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10830
    • View Profile
    • development blog
    • Email
Re: [Resolved]SoundBuffer crashing program?
« Reply #5 on: January 30, 2014, 09:12:47 am »
I got it working now! The problem was with the DLL files not being in the right folder. Specifically the DLL files found in "bin" in the SFML-2.1 folder. put them in my project folder and it now works like a charm.

Okay... i copied both openal32.dll and libsndfile-1.dll from githubs x64 bin directory and it didn't crash.
Weird that the ones that came when i built sfml didn't work.
Both of you seem to have different versions of those DLLs in a directory that is in PATH, because if the DLLs couldn't be found, the application would fail with an error showing what's missing. Since that doesn't happen, your application is loading the DLL from somewhere, but the versions mismatch.

Generally I try to avoid putting DLLs in directory that are in PATH, to prevent such things.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

pinko64

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: [Resolved]SoundBuffer crashing program?
« Reply #6 on: January 30, 2014, 04:00:22 pm »

Nope i had to copy the files to the application's directory. So no, those ddl's never got loaded from PATH.
It was just that the first set(libsndfile-1.dll and openal32.dll) found in the SFML/install path/bin did crash the program.
But got working after i replaced those 2 files with the files from GitHubs extlibs/bin/x64.

So those two files didn't get built when i built the sfml, no?  Makes sense, though.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10830
    • View Profile
    • development blog
    • Email
Re: [Resolved]SoundBuffer crashing program?
« Reply #7 on: January 30, 2014, 04:15:52 pm »
The DLLs are pre-built so you don't have to, not sure what you downloaded at first, but I'm glad it worked when you got them from GitHub directly.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything