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

Author Topic: File Path  (Read 2637 times)

0 Members and 2 Guests are viewing this topic.

NameUser

  • Newbie
  • *
  • Posts: 30
    • View Profile
File Path
« on: September 10, 2012, 12:33:16 am »
Heyo.

When I moved computers, SFML started doing something odd. While before that it had started it's file path when loading images or files at the project, meaning I could easily include images or needed files within the project's folder, it now starts at the base. Because of this, I've had to keep my files in my C: directory and link to them there. It was a nuisance, but I just dealt with it. Now that I'm nearing giving out a very early alpha of my game to a few people, that's no longer an option.

Is there any reason SFML might no longer be starting the file path at the proper directory? If not, how can I go about manually setting to the file path to start at the project when the path to the project from the base might vary?
« Last Edit: September 10, 2012, 12:36:24 am by NameUser »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: File Path
« Reply #1 on: September 10, 2012, 12:44:06 am »
A C++ application will start search for resources given through a relative path, relativly to the working directory. Why your applications switch automatically the working directory to C:\ I don't know. Do you call your application with a symbolic link, that might use a diffrent working directory?
How do you run your application?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

NameUser

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: File Path
« Reply #2 on: September 10, 2012, 01:25:58 am »
VC++
Debug -> Start Debugging

That usually. Though just running the exe directly yields the same results.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: File Path
« Reply #3 on: September 10, 2012, 01:28:43 am »
Well from VS and the default path you'll have to put the files next to the project file, otherwise you can change the working directory in Project->Preferences->C/C++->Debugging->Working Directory

And if you run the EXE from the explorer then the resources need to be directly next to the EXE.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/