4

我在 Visual C++ 2010(Win32 应用程序,非托管代码)中有一个项目,其中我遇到了一个非常奇怪的行为。我放了一个断点,它根本不会中断!

线索:

  • 在exe文件路径中生成一个PDB文件。

  • 调试/模块窗口显示消息“二进制文件未使用调试信息构建。”。

  • 手动加载 PDB 文件(调试/模块,右键单击可执行模块,从/符号路径加载符号,然后双击 PDB 文件)显示“在此文件夹中找不到匹配的符号文件。”。

我的设置:

  • C++/通用/调试信息格式:程序数据库。
  • C++/优化:禁用。
  • C++/代码生成/运行库:多线程调试。
  • 链接器/调试/生成调试信息:是的。
  • 链接器/调试/生成程序数据库:$(TargetDir)$(TargetName).pdb。

编译器命令行:

/I"..\..\calibur64k\include" /I"C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include" /Zi /nologo /W3 /WX- /Od /Oy- /D "D3D_DEBUG_INFO" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MTd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fp"Debug\calibur_app.pch" /Fa"Debug\" /Fo"Debug\" /Fd"Debug\vc100.pdb" /Gd /analyze- /Zl /errorReport:queue 

链接器命令行:

/OUT:"C:\Users\David\Desktop\calibur64k\vs2010\Debug\calibur_app.exe" /INCREMENTAL:NO /NOLOGO "kernel32.lib" "user32.lib" "d3dcompiler.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" "C:\Users\David\Desktop\calibur64k\vs2010\Debug\calibur64k.lib" /MANIFEST /ManifestFile:"Debug\calibur_app.exe.intermediate.manifest" /ALLOWISOLATION /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\Users\David\Desktop\calibur64k\vs2010\Debug\calibur_app.pdb" /ASSEMBLYDEBUG /SUBSYSTEM:WINDOWS /PGD:"C:\Users\David\Desktop\calibur64k\vs2010\Debug\calibur_app.pgd" /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:QUEUE

我在互联网上找到的任何东西都没有帮助我:(有什么想法吗?谢谢!

4

2 回答 2

3

My Settings of Visual c++ 2010:

Linker/Manifest File/Generate Manifest: Yes. Linker/Manifest File/Allow Isolation: Yes. Linker/Embedded IDL/Ignore embedded IDL: No.

I have used these settings in all of my programs and break points are successfully hit.

So, my inference is that what you have proposed might not be the right solution.

于 2012-07-07T17:03:40.477 回答
3

问题已通过反复试验解决:)

对于任何可能感兴趣的人:

Linker/Manifest File/Generate Manifest:设置为 No. Linker/Manifest File/Allow Isolation:设置为 No. Linker/Embedded IDL/Ignore embedded IDL:设置为 Yes。

而已。可能为 C++ 项目错误地设置了生成的 PDB 文件清单或可执行清单?

感谢您的回答。

于 2012-07-07T13:04:00.040 回答