Problem opening debug files

Use this board to ask specific questions about the DirectX 9 book, or specific problems you are having with it (e.g. problems understanding a section or source code). If relevant, include the chapter, page number, sample program name, or a brief code snippet.

Problem opening debug files

Postby Shaktal on Tue Feb 16, 2010 5:34 am

Hello,

I have been working through your book (slowly but surely :D), and I have come across a problem. When I debug the application, the files compile, but then when I try to run the error, I just receive an error message:
error message info wrote:Title: Unexpected error encountered
Message: File:
Buttons:Yes/No (If I click no, it just redisplays the error)


I have tried to resolve this, but I cannot figure out a way to do this.

I am running windows 7, and I have the latest version of the DirectX SDK.

Also if it helps, I cannot run the precompiled accompaning programs that are downloadable from this website.

Please help,
Thomas Russell :)
Shaktal
 
Posts: 31
Joined: Mon Feb 15, 2010 6:39 pm

Re: Problem opening debug files

Postby Hieran_Del8 on Wed Feb 17, 2010 11:32 am

Shaktal wrote:When I debug the application, the files compile,

Does the compiled source link correctly? As good programming practice, compile the source files, then build the solution (the linker stage). If all is good, then run the debug.

I'm guessing it linked fine, but the error message doesn't reveal much. I, too, have windows 7 (64bit home premium) and the latest dx sdk (feb2010), and using Visual Studio 2008 pro. Can you report more of the error message?

Shaktal wrote:I cannot run the precompiled accompaning programs that are downloadable from this website.

Which programs are you referring to? If you're referring to the project/solution files, you don't need those anyway--only the source code.

What programming environment are you using?
Hieran_Del8
 
Posts: 203
Joined: Fri Oct 03, 2008 12:18 pm
Location: Marengo, IL

Re: Problem opening debug files

Postby Shaktal on Thu Feb 18, 2010 4:27 am

Thank you for your reply. :)

Yes, the source code compiled correctly, the log is below:
Debug Log wrote:
Creating temporary file "c:\Users\Thomas\Desktop\Direct X\Chapter 5\SpriteDemo\Debug\RSP00000140245208.rsp" with contents
[
/OUT:"C:\Users\Thomas\Desktop\Direct X\Chapter 5\SpriteDemo\Debug\SpriteDemo.exe" /INCREMENTAL /MANIFEST /MANIFESTFILE:"Debug\SpriteDemo.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"c:\Users\Thomas\Desktop\Direct X\Chapter 5\SpriteDemo\Debug\SpriteDemo.pdb" /SUBSYSTEM:WINDOWS /DYNAMICBASE:NO /MACHINE:X86 d3d9.lib d3dx9d.lib dxguid.lib DxErr9.lib dinput8.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

".\Debug\d3dApp.obj"

".\Debug\DirectInput.obj"

".\Debug\GfxStats.obj"

".\Debug\SpriteDemo.obj"

".\Debug\SpriteDemo.exe.embed.manifest.res"
]
Creating command line "link.exe @"c:\Users\Thomas\Desktop\Direct X\Chapter 5\SpriteDemo\Debug\RSP00000140245208.rsp" /NOLOGO /ERRORREPORT:PROMPT"
Creating temporary file "c:\Users\Thomas\Desktop\Direct X\Chapter 5\SpriteDemo\Debug\RSP00000240245208.rsp" with contents
[
/out:".\Debug\SpriteDemo.exe.embed.manifest" /notify_update /manifest

".\Debug\SpriteDemo.exe.intermediate.manifest"
]
Creating command line "mt.exe @"c:\Users\Thomas\Desktop\Direct X\Chapter 5\SpriteDemo\Debug\RSP00000240245208.rsp" /nologo"
Creating temporary file "c:\Users\Thomas\Desktop\Direct X\Chapter 5\SpriteDemo\Debug\BAT00000340245208.bat" with contents
[
@echo Manifest resource last updated at %TIME% on %DATE% > ".\Debug\mt.dep"
]
Creating command line """c:\Users\Thomas\Desktop\Direct X\Chapter 5\SpriteDemo\Debug\BAT00000340245208.bat"""


Hieran_Del8 wrote:Can you report more of the error message?

The Error message is extremely vague and unhelpful, what I showed before is all I get, the program fails to run and just displays a white screen whilst the error displays.


Hieran_Del8 wrote:Which programs are you referring to? If you're referring to the project/solution files, you don't need those anyway--only the source code.

What programming environment are you using?


I am referring to the exe's that come with some of the projects.

I am using Visual Studio 2008 Professional as well.

Again, thanks for your reply, I appreciate it. ;)
Shaktal
 
Posts: 31
Joined: Mon Feb 15, 2010 6:39 pm

Re: Problem opening debug files

Postby Hieran_Del8 on Thu Feb 18, 2010 8:45 am

Shaktal wrote:The Error message is extremely vague and unhelpful, what I showed before is all I get, the program fails to run and just displays a white screen whilst the error displays.

Hmm. According to msdn:
This error generally occurs when Visual Studio receives data in an unexpected format or receives data from an unexpected source.
To correct this error
*Close and then restart Visual Studio.

http://msdn.microsoft.com/en-us/library/ba78632y.aspx

It also may be some line in the program throwing an exception. Try stepping through the program until you figure the error (use breakpoints or, use F10 to step through the program, F11 to step into a function).

If you can't enter the program at all, then it might be how the program was compiled for the target machine (reporting x86). Is your platform 64bit, and if so, is it an amd or itanium chipset?

Shaktal wrote:I am referring to the exe's that come with some of the projects.

I'm sorry. Which book is it? I checked through the part 2 source code of the directx9.0c shader book and couldn't find any executables.

Shaktal wrote:I am using Visual Studio 2008 Professional as well.

Have you installed sp1 for vs2008? You can get it here:
http://www.microsoft.com/downloads/details.aspx?FamilyId=FBEE1648-7106-44A7-9649-6D9F6D58056E&displaylang=en

If you prefer offline install, you can get the iso for the service pack at:
http://www.microsoft.com/downloads/details.aspx?FamilyId=27673C47-B3B5-4C67-BD99-84E525B5CE61&displaylang=en
Hieran_Del8
 
Posts: 203
Joined: Fri Oct 03, 2008 12:18 pm
Location: Marengo, IL

Re: Problem opening debug files

Postby Shaktal on Thu Feb 18, 2010 10:46 am

Hmm, the error happens even if I run the file outside of the development environment (ie. in a release build).

Also, I don't think it's an error with the code, because when I first encountered the error and couldn't resolve it, I downloaded the Source code from this site and compiled it, I get 5 warnings during the compilation process (mainly apparently obsolete functions), but it compiled and linked successfully.

And your right, there aren't any pre-compiled executables in the downloadable, I was mistaken (must have been a previous attempt at learning Direct X).

I am running Windows 7 Ultimate 32-bit, so I don't think that it is so do incompatibility.

Thanks for helping, I really want to get to grips with Direct X. :)
Shaktal
 
Posts: 31
Joined: Mon Feb 15, 2010 6:39 pm

Re: Problem opening debug files

Postby Hieran_Del8 on Thu Feb 18, 2010 8:56 pm

Shaktal wrote:the error happens even if I run the file outside of the development environment (ie. in a release build).

Have you tried debug stepping through the app?

Also, you may be able to check control panel->Administrative Tools->Event Viewer and look at the "Error" table for any error events that were thrown, with possibly more information about the error. I say "may" because I've never used Administrative Tools before, though a few sites seem to suggest that errors/events would be reported in this log.

Other than that, I can't say I really know. Have you tried building simpler apps and running those, such as a simple console app, a simple win32 app without directx, or a simple directx app like the the first one appearing in here:
http://www.d3dcoder.net/phpBB/viewtopic.php?f=3&t=217
Hieran_Del8
 
Posts: 203
Joined: Fri Oct 03, 2008 12:18 pm
Location: Marengo, IL

Re: Problem opening debug files

Postby Shaktal on Fri Feb 19, 2010 3:54 am

Hello,

I am able to compile simple Direct X applications, like the one in Chapter 4 (Initialisation and drawing "Hello Direct 3D"). I am also able to compile some advanced source code (namely the Half-life 2 Source Code). So I don't see why these applications are not running. But it's probably a stupid mistake that I am making. Also, my console applications are working, so there is no problem there. I am completely confused. :cry:

I will try stepping through the program. Thanks. :)

Update: I can compile and run the application that you gave me the link to without any issues.
Shaktal
 
Posts: 31
Joined: Mon Feb 15, 2010 6:39 pm

Re: Problem opening debug files

Postby Hieran_Del8 on Fri Feb 19, 2010 8:54 am

Shaktal wrote:I am able to compile simple Direct X applications, like the one in Chapter 4 (Initialisation and drawing "Hello Direct 3D"). I am also able to compile some advanced source code (namely the Half-life 2 Source Code). So I don't see why these applications are not running.
[...]
Update: I can compile and run the application that you gave me the link to without any issues.

So all the book examples, and the half life 2 source compiles, but none of them run. The only app you got working was the one I sent a link to. The difference between the app linked to and the book examples is that the linked example only uses d3d9.h and links to the library d3d9.lib. The book's examples rely on d3dx9.h and d3dx9.lib, as well as some other libraries sometimes (ie. direct input). If you don't find anything by stepping (ie. the program fails to let you step into it at all), it may be related to your d3dx9 libraries.

Btw, how did you get the half-life 2 source code? I'd like to get my hands on that.
Hieran_Del8
 
Posts: 203
Joined: Fri Oct 03, 2008 12:18 pm
Location: Marengo, IL

Re: Problem opening debug files

Postby Shaktal on Fri Feb 19, 2010 9:05 am

Hello,

All of the applications compile, but only your application, the HL2 code and my Console apps work. The program does let me step into the code (I think (I have not had to do this before)), but I will take a look at the direct X 9 libraries.

I the mean time shall I try and compile the Direct X 10 books Source code, and see whether I get the same type of error, just to rule out Library issues.

Regarding the Half-life 2 Source Code, If you want the files then an easy way to get the code is to go into the SDK and to create a mod, that gives all of the uncompiled files (excluding a few precompiled ones (tier0.dll, tier1.dll etc.) but I think that it is possible to change these (with the right tools etc.)) that cover the majority of the games functionality. I am currently editing that, but I need to change some of the Shaders, and not being very experienced with HLSL I am having slight troubles doing that, and learning Direct X code has been on my mind for years, so I decided that I will definately get to grips with the basics this year.

Thanks for your help,
Thomas Russell :)

Update: Interestingly enough, when I compiled the Direct X 10 Code, although it worked by pressing the debug button at the top of Visual Studio, when I tried to run the file outside of the development environment it gave me the following error (which looks like a completed error of the original problem):
Error Message wrote:Title: "Unexpected Error Encountered"
Message:"File: c\users\thomas\desktop\dxtest\chapter12\normalmap\effects.cpp
Line: 26
Error Code: D3D10_ERROR_FILE_NOT_FOUND (0x88790002)
Calling: sky.fx
Do you want to debug the application?"
Options: "Yes/No"


However, this is one of the projects that I downloaded from this website so I doubt there is a file missing. Also, if there is a file missing, maybe this is the same problem I am having with my DirectX 9.0c Application?
Shaktal
 
Posts: 31
Joined: Mon Feb 15, 2010 6:39 pm

Re: Problem opening debug files

Postby Hieran_Del8 on Fri Feb 19, 2010 9:40 pm

Shaktal wrote:when I tried to run the file outside of the development environment it gave me the following error

The error is probably because the executable cannot find the fx file as the fx file is not in the same folder as the exe. Move the exe to the same folder as the resources (probably just in the project's directory, not the solution directory where it currently resides).

Shaktal wrote:The program does let me step into the code (I think (I have not had to do this before))

Wherever the program flips out is the call that throws the error message while debugging. F10 steps through the program, F11 steps into a function call.

Shaktal wrote:Regarding the Half-life 2 Source Code, If you want the files then an easy way to get the code is to go into the SDK and to create a mod, that gives all of the uncompiled files (excluding a few precompiled ones (tier0.dll, tier1.dll etc.) but I think that it is possible to change these (with the right tools etc.)) that cover the majority of the games functionality.

Ah, that's how you get it! Thanks for the revelation! :D I've been desiring a glimpse into the engine...

Shaktal wrote:looks like a completed error of the original problem

Gosh, if that's been the problem, what a nightmare this has put you through! Remember, visual studio maintains all resource files in the project's directory, and keeps the solution in the solution's directory (ie. "Debug" or "Release"). When running the application through visual studio, the project's directory is used as the application's folder. When running the application outside of visual studio, the application's actual folder--the solution directory--is used as the application's folder.

I guess if that is really the problem, the last point would be trying to move the resources inside the correct directory.
Hieran_Del8
 
Posts: 203
Joined: Fri Oct 03, 2008 12:18 pm
Location: Marengo, IL

Re: Problem opening debug files

Postby Shaktal on Sat Feb 20, 2010 3:36 am

Wow, It's finally working!

God, I can't believe it was such a simple problem all along! So much for useful error reporting... :D

Thanks so much for your help, I really appreciate it! I can finally get down to learning Direct X now (albeit 3 iterations late :lol: )
Shaktal
 
Posts: 31
Joined: Mon Feb 15, 2010 6:39 pm

Re: Problem opening debug files

Postby Hieran_Del8 on Sun Feb 21, 2010 7:49 am

You're welcome, and congratulations! I wish you many successful developments. :)
Hieran_Del8
 
Posts: 203
Joined: Fri Oct 03, 2008 12:18 pm
Location: Marengo, IL


Return to DirectX 9 Book

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron