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

Author Topic: Visual Studio launches a program, that can't find it's resources...  (Read 6571 times)

0 Members and 1 Guest are viewing this topic.

Flash619

  • Full Member
  • ***
  • Posts: 142
    • View Profile
         Well I've had this every time I have tried to make a program, finally I felt like actually having debuging might be a useful tool. So the problem is this, when Visual Studio launches a program, either in debug or release, it will not find any of it's resources, and thusly, not work. However, I CAN go to the debug/release folder, run it manually, and it works perfectly. It just won't work when Visual Studio launches it.

           I decided to post this question here because this community has been a big help so far. ^_^ I don't believe it to be a specific issue with SFML. It looks more like some screwy setting in Visual Studio, but upon googling the issue, I found NOTHING of other people having this issue. I guess that means either 1, its a simple fix that everyone knows, or 2. I'm just that unlucky of a person. So I'm looking foreward to your input! :D

...woundering if I should try to find a microsoft forum to ask this same thing...

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10819
    • View Profile
    • development blog
    • Email
Re: Visual Studio launches a program, that can't find it's resources...
« Reply #1 on: July 16, 2012, 03:51:06 pm »
I wonder what you were googling for, because this question gets asked about every week in here... ::)

VS searchs for resources in the project folder, this is where the *.vcxproj file can be located. The working directory (or if wanted the build directory) can be changed in the project settings.

If you don't change anything you'll just have to place your resources next to the project file and you're good. :)
« Last Edit: July 16, 2012, 03:52:55 pm by eXpl0it3r »
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Flash619

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: Visual Studio launches a program, that can't find it's resources...
« Reply #2 on: July 16, 2012, 04:40:45 pm »
I wonder what you were googling for, because this question gets asked about every week in here... ::)

VS searchs for resources in the project folder, this is where the *.vcxproj file can be located. The working directory (or if wanted the build directory) can be changed in the project settings.

If you don't change anything you'll just have to place your resources next to the project file and you're good. :)

Well, I copied my resource folder right next to the vcxproj file. I still have the same issue yet. I looked in the project settings, but really have no clue what settings I'm looking to change.  :-\ I don't even know if I want to change settings, because having one resource folder seems nice if it can be done that way. Still I've tried placing the resource folder in both the debug, and release folders, the root project folder, and the folder with the "vcxproj" file. Not sure what I'm missing...

Also, I just think its odd that the .exe is put in the /debug/ folder but that it looks for resources in the folder /../MyProject.

Anyway, let me know what you think is going wrong. *sigh* if it wasn't for problems like these, I could actually do something.
« Last Edit: July 16, 2012, 04:49:57 pm by Flash619 »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10819
    • View Profile
    • development blog
    • Email
Re: Visual Studio launches a program, that can't find it's resources...
« Reply #3 on: July 16, 2012, 04:51:09 pm »
So if your resouces are in a folder you also set the file paths in the code, right?
(E.g. you got the folder "res" with the image "img.png" so you wrote texture.loadFromFile("res/img.png"); )

Do you get errors in the console or do the resouces just not show?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Flash619

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: Visual Studio launches a program, that can't find it's resources...
« Reply #4 on: July 16, 2012, 04:56:36 pm »
So if your resouces are in a folder you also set the file paths in the code, right?
(E.g. you got the folder "res" with the image "img.png" so you wrote texture.loadFromFile("res/img.png"); )

Do you get errors in the console or do the resouces just not show?

"Recource/SplashScreen/PredawnStudios/predawn_splash.theora.ogv" //How I locate my files.
 

Quote
FFmpeg error: unable to open file Recource/SplashScreen/PredawnStudios/predawn_splash.theora.ogv

The same will happen for any images/audio files.

If I go to were the .exe was output, and double click to run it. It runs fine without errors. Only when launched by visual studio, will it not find anything it needs.

 ??? Haha, you see my confusion? XD

Just tried searching the forum.... I wasn't sure what search string to use, but I didn't find anything through the search function. >_< Oh well, that could be due to bad topic names though.

I'm still diging through project settings, but I'm not finding anything that says "Path to resources". Hahaha, oh boy.
« Last Edit: July 16, 2012, 05:33:36 pm by Flash619 »

Flash619

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: Visual Studio launches a program, that can't find it's resources...
« Reply #5 on: July 16, 2012, 05:44:08 pm »
AHA! Figured out that they need to be in

"Visual Studio 2010\Projects\Genesis\Genesis\Debug"

Now time to see if I can modify debug/release to use the same resource path! :D

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10819
    • View Profile
    • development blog
    • Email
Re: Visual Studio launches a program, that can't find it's resources...
« Reply #6 on: July 16, 2012, 07:08:56 pm »
Then you must have somehow changed the default working directory (unless you always start your application without the debugger...). ;-)
You can find the settings in Project->Settings->Debugging
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Flash619

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: Visual Studio launches a program, that can't find it's resources...
« Reply #7 on: July 16, 2012, 08:08:13 pm »
Then you must have somehow changed the default working directory (unless you always start your application without the debugger...). ;-)
You can find the settings in Project->Settings->Debugging

Oh wow, turns out I changed that while trying to fix it. I reset it to default. We're good now, thanks for the assistance! :D