Why I get a "Application failed to initialize properly (0xc0000018)" when I build program in vs2015 sometimes

0

I write a c++ program using visual studio 2015 community in windows 7(64bit).

When I begin to run the program, sometimes the program will terminate, and a dialog box shows up, saying

"Application failed to initialize properly 0xc0000018".

Why do I get this error sometimes rather than always? Thanks a lot.

c++
visual-studio-2015
asked on Stack Overflow Jan 20, 2016 by victorzhang • edited Jan 22, 2016 by Matt

1 Answer

-1

Besides a bad application itself (that should be possible to track in the debugger):

This might be a corrupted Windows installation or Windows registry as well. Do you see it only for your application or also for some other applications?

It might be caused e.g. by some DLL that is built to be installed at fixed address, it might be a virus, malware, or even antivirus getting into the way.

Some of the reasons/solutions are mentioned e.g. here: https://superuser.com/questions/610495/the-application-was-unable-to-start-correctly-0xc0000018-windows-8-x64

The first thing to try is to remove the contents of APPINIT_DLLS in the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\­Microsoft\WindowsNT\CurrentVersion\Windo­­ws - some of the DLLs loaded there might cause the problem.

The reason you do not see it every time could be that sometimes there might be some other DLL loaded on the particular address before the DLL with the fixed address requirement is to be loaded, so the conflict only occurs then.

answered on Stack Overflow Jan 20, 2016 by axalis • edited Mar 20, 2017 by Community

User contributions licensed under CC BY-SA 3.0