简体   繁体   中英

Why does MSVS 2010 MFC project depend on vcredist_x86.exe for MSVS 2008?

I have an MFC project in MSVS 2010. When I compile it, MSVS generates manifest file that contains the following lines:

<assemblyIdentity publicKeyToken="1fc8b3b9a1e18e3b"
    processorArchitecture="x86" version="9.0.21022.8"
    name="Microsoft.VC90.CRT" type="win32"/>

As a result, I get a binary that depends on both vcredist_x86.exe for MSVS 2008 and vcredist_x86.exe for MSVS 2010, though it actually uses only vcredist_x86.exe for MSVS 2010!

I tried to switch off manifest generation in project properties. After it my app started to work with only vcredist_x86.exe for MSVS 2010 installed. But some controls (especially comboboxes) broke and began to be displayed incorrectly. I guess this happens because windows doesn't have the following information from manifest any more:

<assemblyIdentity language="*" publicKeyToken="6595b64144ccf1df"
    processorArchitecture="x86" version="6.0.0.0"
    name="Microsoft.Windows.Common-Controls" type="win32"/>
  1. Why does MSVS write a wrong version of CRT in the manifest file?
  2. How to fix the problem/make MSVS write the correct version of CRT in the manifest file?

I figured it out. I had a reference to libcurl.lib which had a reference to openssl libs compiled in MSVS 2008... After rebuilding libcurl with the proper versions of openssl the reference to crt 9.0 disappeared from the manifest file.

Probably this happens because of the platform toolset in project properties.

Change it to v100 (I suppose now it is set to v90), re-activate manifest generation and embedding (Manifest Tool\\Input and Output) and rebuild your project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM