Fatal error c1900:Il mismatch between 'p1 'version' 20060201 'and 'p2 'version' 20050411'
......
Linking executable -...
Fatal error c1900 :?IlMismatch'P1'Version' 20060201 'and'P2'Version' 20050411'
......
This error only occurs during amd64 build, while the x86 build is normal.
?
?
Main reasons:
Some ltcg libraries compiled by the updated compiler are used for the link. The reason why x86 is normal is that the x86 lib used for the link is normal, while the amd64 Lib is ltcg Lib.
?
Solution:
1) Update the currently used compilation link tool to match it with Lib. Of course, the compiled binary file may change (the optimization may be different), so you may need to retest it.
2) use a library without ltcg
Details:
MsdnAboutC1900Information:
Error message?IlMismatch between 'tool1' version 'number1' and 'tool2' version 'number2'
Tools run in varous passes of the compiler do not match. number1 and number2 refer to the dates on the files. for example, in pass 1, the compiler front end runs (c1.dll) and in pass 2, the compiler back end runs (c2.dll ). the dates on the files must match and if they do not, reinstall and use the current version of each tool.
Il-Intermiate language (not msil in managed code), also known as intermediate representations, is the internal language used to compile the code generation link.
General Compilation link process:
1) pre-compile preprocess
2) frontend compilation (C1/c1xx)-this step will generateIl
3) Back-end compilation (C2)-this step will useIlAnd generate real binary codes.
4) Link-this step will link all OBJ/lib, merge various sections of PE, resolve symbol, and so on, and then generate the final binary
Note that:C1900Is a compilation error becauseIlIt is generated by the front-end of the compiler and used by the backend. However, we encountered this in the Link stage, so we can almost certainly use it.Ltcg.
Ltcg-Msdn.microsoft.com/library/chs/vccore/html/vcgrfltcglinktimecodegeneration.asp
Ltcg (Link Time Code Generation) or WPO (whole program optimization)
-During compilation, only the information of the current module is often used, and the entire program can be obtained during linking. Therefore, generating code During linking can theoretically achieve higher optimization results. The actual ltcgformat is to merge step 3 (c21_with step 4), or call c2.dll by using link .exe.IlAnd generate real binary codes. The merged compilation link process becomes:
1) Compile: cl.exe? /GL
2) Link: link.exe/ltcg
Additionally, ltcg allows optimization of a single module-that is, you do not need to use/GL for all modules. When linking, you only need to detect that one module (OBJ/LIB) is compiled with/GL, the link uses ltcg.
This error occurs because the Lib used for Link compilation is '000000' c2.dll/GL, which can only be explained by '000000' c2.dll.IlThe buildenvironment we use is '20050411', and link.exe calls the c2.dll of '123.
UseLink-dump-disasm <yourlib. Lib>Check whether/GL is used. The common lib dump will see the Assembly Code, which containsIlLib won't