LNK4204 warning and D3D file loading crash - visual-studio-2010

About a month ago, I started to dive into Frank Luna's "Introduction to 3d Programming with Directx11". I had no problems up until now and have made it through a good chunk of the book. Recently, I had to switch computers and started by setting up the first demo in the book to make sure everything was properly configured. I set this demo up on my old computer about a month ago with no issues, now I can't even get this basic demo to run on the new computer. I'm unsure whether the warnings are related to the crash or not.
Warnings are as follows:
1> Creating library C:\Users\Rizzmond\Desktop\test\Debug\test.lib and object C:\Users\Rizzmond\Desktop\test\Debug\test.exp
1>Effects11d.lib(d3dx11dbg.obj) : warning LNK4204: 'C:\Users\Rizzmond\Desktop\test\Debug\vc100.pdb' is missing debugging information for referencing module; linking object as if no debug info
1>Effects11d.lib(d3dxGlobal.obj) : warning LNK4204: 'C:\Users\Rizzmond\Desktop\test\Debug\vc100.pdb' is missing debugging information for referencing module; linking object as if no debug info
1>Effects11d.lib(EffectAPI.obj) : warning LNK4204: 'C:\Users\Rizzmond\Desktop\test\Debug\vc100.pdb' is missing debugging information for referencing module; linking object as if no debug info
1>Effects11d.lib(EffectLoad.obj) : warning LNK4204: 'C:\Users\Rizzmond\Desktop\test\Debug\vc100.pdb' is missing debugging information for referencing module; linking object as if no debug info
1>Effects11d.lib(EffectNonRuntime.obj) : warning LNK4204: 'C:\Users\Rizzmond\Desktop\test\Debug\vc100.pdb' is missing debugging information for referencing module; linking object as if no debug info
1>Effects11d.lib(EffectReflection.obj) : warning LNK4204: 'C:\Users\Rizzmond\Desktop\test\Debug\vc100.pdb' is missing debugging information for referencing module; linking object as if no debug info
1>Effects11d.lib(EffectRuntime.obj) : warning LNK4204: 'C:\Users\Rizzmond\Desktop\test\Debug\vc100.pdb' is missing debugging information for referencing module; linking object as if no debug info
1>LinkEmbedManifest:
1> Creating library C:\Users\Rizzmond\Desktop\test\Debug\test.lib and object C:\Users\Rizzmond\Desktop\test\Debug\test.exp
1>Effects11d.lib(d3dx11dbg.obj) : warning LNK4204: 'C:\Users\Rizzmond\Desktop\test\Debug\vc100.pdb' is missing debugging information for referencing module; linking object as if no debug info
1>Effects11d.lib(d3dxGlobal.obj) : warning LNK4204: 'C:\Users\Rizzmond\Desktop\test\Debug\vc100.pdb' is missing debugging information for referencing module; linking object as if no debug info
1>Effects11d.lib(EffectAPI.obj) : warning LNK4204: 'C:\Users\Rizzmond\Desktop\test\Debug\vc100.pdb' is missing debugging information for referencing module; linking object as if no debug info
1>Effects11d.lib(EffectLoad.obj) : warning LNK4204: 'C:\Users\Rizzmond\Desktop\test\Debug\vc100.pdb' is missing debugging information for referencing module; linking object as if no debug info
1>Effects11d.lib(EffectNonRuntime.obj) : warning LNK4204: 'C:\Users\Rizzmond\Desktop\test\Debug\vc100.pdb' is missing debugging information for referencing module; linking object as if no debug info
1>Effects11d.lib(EffectReflection.obj) : warning LNK4204: 'C:\Users\Rizzmond\Desktop\test\Debug\vc100.pdb' is missing debugging information for referencing module; linking object as if no debug info
1>Effects11d.lib(EffectRuntime.obj) : warning LNK4204: 'C:\Users\Rizzmond\Desktop\test\Debug\vc100.pdb' is missing debugging information for referencing module; linking object as if no debug info
1> test.vcxproj -> C:\Users\Rizzmond\Desktop\test\Debug\test.exe
The crash is from the D3D11CompileFromFile returning a D3D11_ERROR_FILE_NOT_FOUND when trying to load a file. I have set this demo up exactly as I did before so I cannot fathom why it is unable to load this "color.fx" file. You can see the relevant code and the solution explorer in a picture here: http://i.imgur.com/vVUe5.jpg
I have tried cleaning and rebuilding the solution.

This error occurs when debug version of a library is linked to the project, but corresponding debug database file (.pdb) is not accessible. You need to re-build Effects11d.lib from sources to generate .pdb on your new computer. Sources of the library are reported to be available: http://www.d3dcoder.net/phpBB/viewtopic.php?f=4&t=241

I encountered a similar problem
---------------------------
Unexpected error encountered
---------------------------
File: d:\3dgameprogramming\code\chapter 6 drawing in direct3d\box\boxdemo.cpp
Line: 310
Error Code: D3D11_ERROR_FILE_NOT_FOUND (0x887c0002)
Calling: D3DX11CompileFromFile
Do you want to debug the application?
---------------------------
the problem is: D3DX11CompileFromFile() unable to find "fx\color.fx",
just copy "....\Code\Chapter 6 Drawing in Direct3D\Box\FX" to the same directory as the executable file.
And no need to recompile.
Picture

Related

What problems cause Visual Studio to say "Source information is missing from the debug information for this module"?

I'm working on a compiler for the CLR, and I mostly have it working. I'm trying to generate debug information, and I can get it to create an embedded PDB in the generated assembly where all the debug metadata looks right. When I load the assembly, the Modules view says "Symbols loaded." But I can't get the debugger to recognize breakpoints, and if I throw an exception inside the code, it says,
Source Not Available
Source information is missing from the debug information for this module.
When I look at the assembly in DotPeek, it does not say "Debug" on the assembly's main name line, the way it does for C# assemblies built with debug information. I'm not sure what's missing, though.
What can cause this error to come up? In case anyone needs a test case to look at, here's one.
EDIT: Please read the question and take note of the Tags. I've gotten a couple different answers on here that are bog-standard "how to get PDBs to load under normal circumstances" answers. This question is not about normal circumstances. I am building the compiler and it is generating incorrect PDBs. I need a way to debug the output of the PDB code that I am generating myself.

How to debug C4722 #import referenced a type from a missing type library; 'missing-type' used as a placeholder

I'm getting the following error when I build a Visual Studio C++ project on Azure Pipeline (Microsoft-hosted agent).
C4722 #import referenced a type from a missing type library;
'missing-type' used as a placeholder
I learned what the error is on the docs.
However, I'm still wondering if there is any way to debug this error further, particularly to know what is the "type" or "missing type library" by name?

Should we use embedded debug symbols or full debug symbols in PDBs published to the symbol server?

I noticed that some .NET Core projects use embedded debug symbols instead of full PDB published to a Symbol Server. For example, consider the following projects:
msbuild - https://github.com/microsoft/msbuild
OrchardCore - https://github.com/OrchardCMS/OrchardCore
I had to compile locally both of them and both do not generate any PDBs (almost), instead they instruct the C# compiler to embed the debug information, including the source code reference (no idea how it works in reality). For instance, OrchardCore uses the following msbuild code in their Directory.Build.props to that end:
<PropertyGroup>
<DebugType>embedded</DebugType>
<EmbedAllSources>true</EmbedAllSources>
</PropertyGroup>
I am trying to understand what is the preferred approach. Would not using embedded debug symbols bloat the size of my binaries? Up until now we have always built our code with Full debug symbols inside PDB files, which we never included in the artifacts, but instead published to our Symbol Server. Should we use embedded instead? Can somebody clarify this point?

LNK1220: '/PGD' requires '/LTCG:[PGINSTRUMENT|PGOPTIMIZE]' specification

While building project in VS2008, I get the error
1>LINK : fatal error LNK1220: '/PGD' requires '/LTCG:[PGINSTRUMENT|PGOPTIMIZE]' specification
It was building fine earlier. I am not sure what I changed in properties and that causing this error now. My Linker -> Optimization settings are such Profile guided database is set to "$(TargetDir)$(TargetName).pgd" and all other fields are set to "Default". Any ideas?

Prevent MSVC from creating debug symbols by source code pragma?

While compiling a large c++ program with msvc .net 2003 and with debug information, I ran into C1067, the fatal compiler error for to big or to large debug symbols. As it is in boost, and I don't want to fiddle around with the source code, the easiest thing would be, if there is a pragma or something that could switch off the generation of debug symbols from source code side. Any idea?
Here's a KB article suggesting compiling with /Z7 (old style debug info). It will give an ignorable warning, and symbol info:
http://support.microsoft.com/kb/122539

Resources