vs2010 debug下调试c++程序时,程序报错:
Runtime Error!
Program: D:\Program Files (x86)\test\test\test.exe
R6030
- CRT not initialized
参考https://blog.csdn.net/chenlycly/article/details/120877146里面的介绍,使用windgb查到
//......
ModLoad: 0f710000 0f74c000 D:\Program Files (x86)\test\test\libcurl.dll
ModLoad: 767c0000 76805000 C:\Windows\syswow64\WLDAP32.dll
ModLoad: 6a4f0000 6a5af000 D:\Program Files (x86)\test\test\MSVCR100.dll
(23d8.2560): Break instruction exception - code 80000003 (first chance)
eax=00000000 ebx=00000000 ecx=e6760000 edx=0014de28 esi=fffffffe edi=00000000
eip=77ec0f74 esp=00baf4c0 ebp=00baf4ec iopl=0 nv up ei pl zr na pe nc
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00000246
*** ERROR: Symbol file could not be found. Defaulted to export symbols for ntdll.dll -
ntdll!LdrVerifyImageMatchesChecksum+0xf1f:
77ec0f74 cc int 3
0:000> kn
# ChildEBP RetAddr
WARNING: Stack unwind information not available. Following frames may be wrong.
00 00baf4ec 77ea0f6f ntdll!LdrVerifyImageMatchesChecksum+0xf1f
01 00baf668 77e69f11 ntdll!RtlUlonglongByteSwap+0x421f
02 00baf6b8 77e59789 ntdll!RtlSetUnhandledExceptionFilter+0x50
03 00baf6c8 00000000 ntdll!LdrInitializeThunk+0x10
发现exe引用的的libcurl.dll是release版的,于是重新编译了一个debug版本的,覆盖掉release版的libcurl.dll后,再次调试发现不报CRT not initialized错误了。
总结:1.windbg是好东西,可以定位到加载到哪个dll失败了;2.程序里如果混用msvcr100.dll和msvcr100d.dll可能会造成CRT not initialized错误。
参考:https://blog.csdn.net/chenlycly/article/details/120877146
微软官方网站中关于“R6030 CRT not initialized”错误的说明。微软该页面的网址为: