SFML community forums

Help => General => Topic started by: magic711 on January 30, 2015, 05:17:34 pm

Title: My First SFML App error
Post by: magic711 on January 30, 2015, 05:17:34 pm
I followed exactly Tutorials for SFML 2.2->Getting started->SFML and Xcode (Mac OS X). The build is successful, but when I run it, it gave me
'window.draw(sprite);       Thread 1: EXC_BAD_ACCESS(code=EXC_I386_GPFLT)'
Title: AW: My First SFML App error
Post by: eXpl0it3r on January 30, 2015, 05:21:15 pm
And your OS version is? And you Xcode version is?
How exactly did you follow the tutorial? Did you do a forum and/or Google search first?
Title: Re: My First SFML App error
Post by: magic711 on January 30, 2015, 06:38:46 pm
OS X 10.9.5
Xcode 6.1.1
I followed steps here http://www.sfml-dev.org/tutorials/2.2/start-osx.php
I created an SFML app, then build and run, after run, I got this error. The program just hung. I did not make any change.
I tried to google, it seemed nobody had the same problem.
Thanks
Title: Re: My First SFML App error
Post by: magic711 on January 30, 2015, 06:47:06 pm
// Load a sprite to display
    sf::Texture texture;
    if (!texture.loadFromFile(resourcePath() + "cute_image.jpg")) {
        return EXIT_FAILURE;
    }
    sf::Sprite sprite(texture);
Is there anything wrong here? Like I said, I did not touch anything here, they are all generated by creating SFML app.
Title: Re: My First SFML App error
Post by: Hiura on January 30, 2015, 07:41:19 pm
Did you updated your SFML version by any chance? I've seen that kind of crash when your header files don't match the binaries you're using. Make sure you have only one version of SFML installed and clean build your project.
Title: Re: My First SFML App error
Post by: magic711 on January 30, 2015, 08:19:43 pm
I did installed the previous version before. But I did not get that version to work, so I gave up. Lately I wanna give SFML another try. I downloaded latest version 2.2. I deleted everything SFML related under /Library/Frameworks, and copied new 2.2 files to there. I installed SFML as frameworks since it is recommended.

I just deleted SFML files under /Library/Frameworks, and tried again, the problem persists. Is there any old files under some other folders I should delete? Thanks
Title: Re: My First SFML App error
Post by: verbrannt on January 30, 2015, 09:32:13 pm
Try to delete headers in /usr/local/include/SFML
Title: Re: My First SFML App error
Post by: magic711 on January 30, 2015, 09:48:13 pm
Try to delete headers in /usr/local/include/SFML
Great. That worked. Thx a lot ;D