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

Author Topic: Running SFML Pre-made examples  (Read 1790 times)

0 Members and 1 Guest are viewing this topic.

mora260

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Running SFML Pre-made examples
« on: August 11, 2013, 05:12:37 am »
I'm new to the SFML, I have worked around with C++ in Linux, now i'm trying to made all work in Mac OS X. I've followed all the steps to install SFML and make it work along with Xcode and I can load the templates and run them correctly. The problems starts when I try to run a pre-made example that comes with the installer of SFML.

It complies correctly, but at the runtime, the command line prompts a messages that says:

"Failed to open sound file "resources/ball.wav" (System error : No such file or directory.)"; but the file is there, so I don't know why it says that.

This is with the pong example. It also happens when I tried to run any other program and it tries to load a sound or a background. I don't know what the problem is.

Please if someone has faced the same issue, some help will be really useful! I'm trying to start with SFML and start making games!  :P

mora260

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Running SFML Pre-made examples
« Reply #1 on: August 11, 2013, 05:44:23 am »
Problem Fixed!!  :D

I started to compare the codes from the pre-made examples and the templates.
When looking for resources, the templates have their own preloaded methods, I added those methods to the pong project, changed the .cpp to include and use those methods, and compiled and run again. It worked perfectly!

This is a workaround for the issue, but i don't know why it is not working the other way!

The post can't be closed, or leave it here so that somebody can use it or add a different solution!

hoten

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
Re: Running SFML Pre-made examples
« Reply #2 on: April 29, 2018, 02:46:39 am »
I ran into the same problem.

I was building the Pong example as sudo, and got the same error as OP. When I built as a regular user, it worked just fine.