As of right now, I am using full path to load a image via sf::Image. But I'm trying to use relative path, but it doesn't really work because the current working directory of the binary is at some weird directory. So I'm asking, how can I load an image using relative path via sf::Image::LoadFromFile(fileName)? I am trying to avoid absolute paths. I tried 'adding' the image files to the same directory as my source, but it doesn't seem to be working. Any help would be great guys.
Asked
Active
Viewed 1,153 times
1 Answers
1
I'm asuming you're using SFML 2 because I had the same issue with SFML 2, but not with 1.6.
This topic on SFMLs site summed up the issue, with some solution. Apparently when SFML2 gets released as a framework we'll beable to link resources correctly again. Until then I'm still using absolute paths.

dotty
- 40,405
- 66
- 150
- 195
-
Actually I'm stil using SFML 1.6, thats weird – dchhetri Jan 31 '12 at 02:51
-
@user814628 Try changing [working directory setting.](http://stackoverflow.com/questions/3396378/change-the-working-directory-in-xcode) – alex vasi Jan 31 '12 at 13:36