Failed to initialize the application normally 0 × 0150002

Source: Internet
Author: User
Tags winsxs folder

For the program compiled with vc2005, there are no errors during compilation, but the runtime prompts "the application initialization fails normally "!! I found all kinds of materials and made various attempts. Everything I said on the Internet was: I had to install vc2005 sp1patch to install vcredist_x86.exe; I had to copy the DLL of the CRT library directly to the program directory;
To clear the Registry; to install a new version of. netframework; to check manifest;

As a result, I tried it for half a day, which is almost a waste of time. The last article above is still correct, but the author described things too tedious .. Now let's take a look at the solution to save you the trouble:

1. vc2003, vc2005, vc2008 and later versions have reconstructed the most basic CRT, MFC, and ATL libraries at the underlying layer. To avoid conflicts between libraries of different versions, the reconstructed library files are generally stored in the C: // Windows/winsxs folder and identified by a specific folder/file name;

2. different from vc6, vc2003, vc2005, vc2008, and later versions introduce the manifest list concept, that is, after the application is compiled, it will generate the corresponding at the same time. manifest file, and. the manifest file is compiled into DLL or EXE as a resource .. The manifest file is actually an XML text file, which records the version and name of the CRT, MFC, and ATL libraries to be referenced in DLL or EXE. Vc6 compiled applications directly call CRT, MFC, and atl dll, while vc2003, vc2005, and vc2008 compiled programs first query records in manifest compiled into resources, search for the corresponding CRT, MFC, ATL library, and released with the library according to the version and name provided by the record. manifest file. The search path includes the current directory, C: // Windows/winsxs
Wait. If the corresponding library file is not found, the system prompts "application initialization failed ";

3. so the solution to this problem is: (a) open the corresponding EXE or DLL in a text editor. manifest file to view the version of the CRT, MFC, and ATL libraries referenced by it. Alternatively, use ultraedit to open the EXE or DLL directly and find the compiled files from the resource area. find the version of the CRT, MFC, and ATL libraries referenced by the manifest information. Alternatively, run the program. When the "Application initialization failed" dialog box appears, right-click "my computer"-"manage"-"Event Viewer"-"system" on the desktop, and double-click to view the records, the cause of the error is that the CRT, MFC, and ATL libraries of a certain version are missing, and the version information is recorded. (B) The version information of the library recorded is generally similar to that of "Microsoft. vc90.debugcrt ", followed by C: // Windows/winsxs
Or, search for the folders and files that contain this string in the installation folder of vc200x and search for the searched DLL and. all manifest files are copied to the folder where the application is located ,. the manifest file must be renamed to "Microsoft. vc90.debugcrt. manifest "(here Microsoft. vc90.debugcrt), so that the application can run normally. (c) note. the manifest file and DLL file must be copied to the application root directory, because the application will compile the internal manifest information and the external. the manifest file is compared before the library DLL is called. It is useless to copy only the DLL file of the database;

4. If both the local compilation and running programs are OK, but the compiled programs cannot be run on other machines, this is probably the reason. In addition, if the message "Incorrect application configuration" is displayed, it is mostly because the above mentioned CRT, MFC, and ATL library versions do not match with the application, which can be solved in the same way;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.