SFML community forums

Help => General => Topic started by: Dark Goomba on January 28, 2014, 04:36:20 am

Title: Setting up SFML
Post by: Dark Goomba on January 28, 2014, 04:36:20 am
Hello everyone!

I'm quite new to sfml 2.1 but I can't manage to even pass the first step: the set up. I went through the installation instructions almost ten times but when I run my program on visual studio 2010 I get these warnings:

C:\...\NewProject\Debug\sfml-system-d-2.dll', Cannot find or open the PDB file
C:\...\NewProject\Debug\sfml-window-d-2.dll', Cannot find or open the PDB file
C:\...\NewProject\Debug\sfml-network-d-2.dll', Cannot find or open the PDB file
C:\...\NewProject\Debug\sfml-graphics-d-2.dll', Cannot find or open the PDB file
C:\...\NewProject\Debug\sfml-audio-d-2.dll', Cannot find or open the PDB file

I put my working directory to C:\...\NewProject\Debug so I thought that might work but it didn't.
I know there's probably something I did wrong or I'm just bad with dlls
Either way, any help is appreciated! :)
Title: Re: Setting up SFML
Post by: zsbzsb on January 28, 2014, 04:53:12 am
Those warnings are fine to ignore as long as you have SFML setup correctly  ;) You only need those files if you plan on debugging SFML (and in that case you would be building SFML from source).

However I would recommend you upgrade to at least Visual Studio 2012 if not 2013 to take advantage of C++11.
Title: Re: Setting up SFML
Post by: Dark Goomba on January 28, 2014, 05:12:36 am
Thanks for the help.
I was using sf::Texture, Texture.loadFromFile() but it seemed to not work. So I guess the installation wasn't the cause in this case. Anyways, I put Picture.png in the same folder as main.cpp but it displayed this: "Failed to load image "Picture.png" Reason : Unable to open file" Is there any way to fix this?
Title: AW: Setting up SFML
Post by: eXpl0it3r on January 28, 2014, 08:20:27 am
Resources get loaded relative to the working directory. With VS the default workung directory is where the project file is located. But you can always change it in the options.
Title: Re: Setting up SFML
Post by: Dark Goomba on January 29, 2014, 04:40:00 am
Ok, I spent some time to check everything. The working directory is set to the same location as the project file. The picture name is spelled right, it is a png, and it's in the correct location. I'm not sure what I did wrong.

Edit: Solved!! I called the picture "Picture.png" and I changed it to just "Picture" and it worked! Well anyways, thanks to everyone above for the useful info on working directories!  ;)