Visual Studio Debugger / Cannot load a data file
I'm using Visual Stu开发者_StackOverflow社区dio on Windows Vista to debug some code which in turn uses the AllegroV5 library.
The code compiles and links fine but when I start the debug it cannot load some data files I have lying around and the program does not start. The program loads (using Allegro routines) several images and graphics (tga, fnt and png formats).
Strange enough, out of Visual Studio, even the executable compiled with DEBUG configuration loads the files correctly and the program starts fine. But out of Visual Studio I can't properly debug my code.
Any ideas?
The problem was in the debugger settings. The executable was setup to be generated in a path different from the standard and the debugger was not setup accordingly.
For setting the debugger go to the project settings in properties -> debugging -> working directory and set it up accordingly.
May be you need to provide additional info on what exactly happens when you try to debug.
Anyways I have provided info on one probable scenario. But you need to confirm which build versions you are using to debug.
To debug any code, you need to have the binaries to have the debug information, to help you load the symbols with the additional "debug" information. However, when you load additional dependent binaries sometimes you must provide the debug version of these dependancy libraries too.
So,
- Make sure you have the all the modules (the EXE and the other libraries you load) to have the debug info in them. Use the debug build versions.
- If you are unable to debug, the debugger should provide some info or the other. Check the output window for any info and post it here.
You mentioned that the debug build of your code, can load the other files and starts fine. Please note that it is possible to build a exe project in DEBUG build, that can load libraries that are in RELEASE build. So it is possible that you can mix-n-match the build configurations of the EXE and the libraries respectively, and run your code.
精彩评论