[try Beta version]
Not logged in

 
Run SDL application from IDE

Feb 11, 2013 at 4:20pm
Hi all,
I have an SDL snake game that uses .png textures. I want to run it from Visual Studio 2012 to debug. The problem is, when I start it, it gives an 'Unhandled Exception' error when it tries to load that textures. Maybe the IDE runs the program from the wrong path? What can I do to fix it?
Thanks!
Feb 12, 2013 at 11:39am
Anybody, please?
Feb 12, 2013 at 11:42am
What is the error exactly...
Feb 12, 2013 at 12:10pm
The problem is most likely with the path. It usually is.

The program will look for the file in the current working directory. If the current working directory is not the same directory as your .png is located it will not find it. If you start your program by double clicking on the executable file the current working directory will be the directory where the executable file is located. If you start your program from the command line the current working directory will be the directory that you set using the cd command. If you start your program from an IDE the current working directory is often set to the project directory (not the source directory) but this can differ between IDEs.
Feb 12, 2013 at 6:19pm
That's what I thought, but I can't find an option to set the path. Let's have another look :)
Last edited on Feb 12, 2013 at 6:36pm
Feb 12, 2013 at 6:26pm
closed account (3qX21hU5)
EDIT: removed because of wrong information
Last edited on Feb 12, 2013 at 6:53pm
Feb 12, 2013 at 6:45pm
@Zereo
This has nothing to do with linking. It is a runtime problem.
Feb 12, 2013 at 6:49pm
closed account (3qX21hU5)
Misread the question sorry about that.
Topic archived. No new replies allowed.