Home > OS >  Unable to Debug C Application in VS 2019
Unable to Debug C Application in VS 2019

Time:09-09

I have a C project that I am able to build and run as an exe just fine.

However, when I try to debug the project in Visual Studio 2019 I get the following error:

"Unhandled exception at 0x75D7C66B (shell32.dll) in MyApp.exe: 0xC0000005: Access violation reading location 0x00000004"

It also says: "Source Not Available: Source information is missing from the debug information for this module"

I don't understand this error. I have set breakpoints right at the beginning of the main() function but it never gets to these breakpoints so I don't know what causes the exception.

I have googled this for quite sometime but haven't found any similar problems.

I hope someone can help. Let me know if you need further details.

Edit: here is the call stack:

shell32.dll!CShellFolderViewOC::GetConnMap(int *) Unknown shell32.dll!`dynamic initializer for 'ATL::IConnectionPointContainerImpl::pConnMap''() Unknown ucrtbase.dll!__initterm() Unknown shell32.dll!dllmain_crt_process_attach() Unknown shell32.dll!dllmain_crt_dispatch() Unknown shell32.dll!dllmain_dispatch() Unknown shell32.dll!__DllMainCRTStartup@12() Unknown ntdll.dll!_LdrxCallInitRoutine@16() Unknown ntdll.dll!LdrpCallInitRoutine() Unknown ntdll.dll!LdrpInitializeNode() Unknown ntdll.dll!LdrpInitializeGraphRecurse() Unknown ntdll.dll!LdrpInitializeGraphRecurse() Unknown ntdll.dll!LdrpPrepareModuleForExecution() Unknown ntdll.dll!LdrpLoadDllInternal() Unknown ntdll.dll!LdrLoadDll() Unknown 01240307() Unknown [Frames below may be incorrect and/or missing] Unknown ntdll.dll!_KiUserApcDispatcher@16() Unknown ntdll.dll!LdrInitializeThunk() Unknown

CodePudding user response:

I fixed it.

In Visual Studio under:

Options -> Debugging -> General

I disabled the option: "Load debug symbols in external process (Native only)"

I still don't really understand why this fixed the problem. If someone could explain I would be grateful.

  • Related