0

在此处输入图像描述在 VS2010 上运行我的 VC++ 应用程序时,出现以下错误:-

'26aprilmadefromnewfoldercode.exe': Loaded 'C:\Documents and Settings\Administrator\My Documents\Visual Studio 2010\Projects\26aprilmadefromnewfoldercode\Debug\26aprilmadefromnewfoldercode.exe', Symbols loaded.
'26aprilmadefromnewfoldercode.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', Cannot find or open the PDB file
'26aprilmadefromnewfoldercode.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', Cannot find or open the PDB file
'26aprilmadefromnewfoldercode.exe': Loaded 'C:\Documents and Settings\Administrator\My Documents\Visual Studio 2010\Projects\26aprilmadefromnewfoldercode\Debug\hdpw32.dll', Binary was not built with debug information.
'26aprilmadefromnewfoldercode.exe': Loaded 'C:\WINDOWS\system32\winmm.dll', Cannot find or open the PDB file
'26aprilmadefromnewfoldercode.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll', Cannot find or open the PDB file
'26aprilmadefromnewfoldercode.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll', Cannot find or open the PDB file
'26aprilmadefromnewfoldercode.exe': Loaded 'C:\WINDOWS\system32\secur32.dll', Cannot find or open the PDB file
'26aprilmadefromnewfoldercode.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll', Cannot find or open the PDB file
'26aprilmadefromnewfoldercode.exe': Loaded 'C:\WINDOWS\system32\user32.dll', Cannot find or open the PDB file
'26aprilmadefromnewfoldercode.exe': Loaded 'C:\WINDOWS\system32\comctl32.dll', Cannot find or open the PDB file
'26aprilmadefromnewfoldercode.exe': Loaded 'C:\WINDOWS\system32\shell32.dll', Cannot find or open the PDB file
'26aprilmadefromnewfoldercode.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', Cannot find or open the PDB file
'26aprilmadefromnewfoldercode.exe': Loaded 'C:\WINDOWS\system32\shlwapi.dll', Cannot find or open the PDB file
'26aprilmadefromnewfoldercode.exe': Loaded 'C:\WINDOWS\system32\setupapi.dll', Cannot find or open the PDB file
Debugger:: An unhandled non-continuable exception was thrown during process load
The program '[5800] 26aprilmadefromnewfoldercode.exe: Native' has exited with code -1073741512 

(0xc0000138)。

我的 exe 文件已构建,但未执行。如何调试进程负载或解决此错误?

4

3 回答 3

3

0xC0000138: Ordinal Not Found我在加载插件 DLL 的 Windows 进程中观察到了同样的异常。该错误是由加载到同一进程中的两个不同版本的COMCTL32引起的。

尝试使用调试器(或Process Monitor)并检查是否有任何机会没有加载两个 COMCTL32 模块,如下所示:

...
'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.18201_none_ec80f00e8593ece5\comctl32.dll'. Symbols loaded.
...
'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_41e6975e2bd6f2b2\comctl32.dll'. Symbols loaded.

如果是这种情况,则将显式 COMCTL32 引用添加到应用程序的清单中:

<dependency>
  <dependentAssembly>
    <assemblyIdentity type="win32" 
      name="Microsoft.Windows.Common-Controls" version="6.0.0.0"
      processorArchitecture="x86" publicKeyToken="6595b64144ccf1df" language="*">
    </assemblyIdentity>
  </dependentAssembly>
</dependency>

使用MSDN 中解释的方法之一:启用视觉样式文章。

于 2014-10-30T12:44:58.553 回答
3

您不会从中获得堆栈跟踪或转储,因为它在动态库加载期间似乎失败了。最好的方法是将其加载到depends.exe 中并查看导入的库和符号,这应该会告诉您找不到哪一个。

看看这个问题:

在 Windows XP 上运行应用程序时出现“找不到指定的过程”错误(异常 c0000139)

它显示了如果您尝试链接在动态链接时不可用的 API 会发生什么,以及如何使用depends.exe 对其进行调试。

于 2012-04-27T12:06:59.223 回答
1

如果您 dll 导出类并使用不同版本的运行时库构建,则可能会发生这种情况。因此,您必须检查您的所有 dll 是否使用与您用于主应用程序构建的相同编译器构建。您需要做的只是清除解决方案并构建新的库,dll 将替换您拥有的旧版本。

于 2012-04-27T10:59:59.797 回答