none
fatal error C1900: Il mismatch between 'P1' version '20080116' and 'P2' version '20070207'

    Question

  • Hi all,

    I have a Team Foundation Build Agent that has Visual Studio Team System 2008 Test Edition installed. One of the solutions that I compile with that Build Agent gives me the following errors:

      VCBUILD : fatal error C1047: The object or library file '.\bin\Release\main.obj' was created with an older compiler than other objects; rebuild old objects and libraries
      LINK : fatal error LNK1257: code generation failed

      VCBUILD : fatal error C1900: Il mismatch between 'P1' version '20080116' and 'P2' version '20070207'
      LINK : fatal error LNK1257: code generation failed

    I've searched online and found that other people have experienced the same problem:

    http://software.intel.com/en-us/forums/intel-c-compiler/topic/62516/
    http://nuicode.com/issues/266

    In the second posting one states "I had the same Error! After installing Service Pack1 for VS2008 it worked!". Thats great for him but I don't see any such update for the Test Edition of Visual Studio Team System 2008 - Test Edition.

    What can I do to get rid of that problem?

    Thanks!

    • Moved by Edwer Fang Friday, August 21, 2009 3:41 AM (From:Visual Studio Team System - Testing)
    Wednesday, August 19, 2009 4:47 PM

Answers

  • Hello ACKH

     

    I once handled a similar case in newsgroups. That case exhibit a almost same symptom. Please check out my summary below:

     

    Problem

    In that case, the customer has a DLL project that you had built on a machine where VS 2008 SP1 was installed. You then attempted to rebuild that project on a machine without SP1, and got a fatal compiler error C1900 “IL mismatch between ‘P1’ version ‘20080116’ and ‘P2’ version ‘20070207’”, and then LNK1257 “Code generation failed”. He found that rebuilding your static library alleviated the errors, but cannot accept this as a workaround because your clients will not have the ability to rebuild the libraries you distribute before they use them.

     

    Cause

    You had built the static library with the /GL (Whole Program Optimization) compiler switch, which requires Link Time Code Generation (/LTCG) when the static library is subsequently linked. These features require that all linked modules be built by the same version of the compiler. In fact, if precompiled headers are used, the same machine must build and link all the involved object code. Therefore, it is highly recommended that static libraries not be built with the /GL switch, since their intended use is quite frequently to support reuse by others.

     

    Solution

    You rebuilt the static library on your VS2008 SP1 machine without the /GL switch, and you no longer encounter this problem.

     

    Please let me know if this info is helpful to you or not.

     

    Regards,

    Jialiang Ge

    MSDN Subscriber Support in Forum

    If you have any feedback of our support, please contact msdnmg@microsoft.com.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Friday, August 21, 2009 7:42 AM
    Moderator
  • The SP1 installer will take care of differences in the various editions.
    Hans Passant.
    Friday, August 21, 2009 4:30 AM
    Moderator

All replies

  • Hello,

    I am moving this post to Visual C++ Language Forum. The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who the newsgroups regularly can either share their knowledge or learn from your interaction with us.

    Thank you for your understanding.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Send us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.
    Friday, August 21, 2009 3:41 AM
  • The SP1 installer will take care of differences in the various editions.
    Hans Passant.
    Friday, August 21, 2009 4:30 AM
    Moderator
  • Hello ACKH

     

    I once handled a similar case in newsgroups. That case exhibit a almost same symptom. Please check out my summary below:

     

    Problem

    In that case, the customer has a DLL project that you had built on a machine where VS 2008 SP1 was installed. You then attempted to rebuild that project on a machine without SP1, and got a fatal compiler error C1900 “IL mismatch between ‘P1’ version ‘20080116’ and ‘P2’ version ‘20070207’”, and then LNK1257 “Code generation failed”. He found that rebuilding your static library alleviated the errors, but cannot accept this as a workaround because your clients will not have the ability to rebuild the libraries you distribute before they use them.

     

    Cause

    You had built the static library with the /GL (Whole Program Optimization) compiler switch, which requires Link Time Code Generation (/LTCG) when the static library is subsequently linked. These features require that all linked modules be built by the same version of the compiler. In fact, if precompiled headers are used, the same machine must build and link all the involved object code. Therefore, it is highly recommended that static libraries not be built with the /GL switch, since their intended use is quite frequently to support reuse by others.

     

    Solution

    You rebuilt the static library on your VS2008 SP1 machine without the /GL switch, and you no longer encounter this problem.

     

    Please let me know if this info is helpful to you or not.

     

    Regards,

    Jialiang Ge

    MSDN Subscriber Support in Forum

    If you have any feedback of our support, please contact msdnmg@microsoft.com.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Friday, August 21, 2009 7:42 AM
    Moderator
  • Hello ACKH

    How are you? I'm writing to check the status of this issue on you side. Are Hans' and my analysises helpful to you? If you have any other questions or concerns, please feel free to post here.

    Regards,
    Jialiang Ge
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Thursday, August 27, 2009 7:46 AM
    Moderator
  • Hi,

     

    try download and install the VCsetup.exe at below.

    http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=f3fbb04e-92c2-4701-b4ba-92e26e408569

    cheers

    Busyboy

    Monday, July 5, 2010 6:01 AM
  • Hi Jialiang Ge,

    I found this commentary on the C1900 bug. I am encountering the same problem. However, I installed SP1, apparently successfully, and also checked the project settings for all of the libraries I am linking for which I have projects, and none appear to be using whole-program optimization. Nonetheless, I am getting the C1900 error.

    Is there a way of inspecting third-party libraries to see how they were built, to see if the cause actually is use of whole-program optimization?

    Could SP1 installation have actually failed, although the installation script reported success?

    Are there any more recent bugfixes that address this problem?

    Thanks!

     

    Monday, July 26, 2010 7:27 PM
  • Hi!

    I had this error message, until now.
    I installed the following contents:

    1. Microsoft.Windows SDK for Windows 7 and .NET Framework 3.5 (ISO)
    2. Microsoft.Windows SDK for Windows 7 and .NET Framework 4 (ISO)
    3. Microsoft.Windows Server 2008 SDK and .NET Framework 3.5 (ISO)

    My operating system is Windows 7 Ultimate x64 SP1 and the problem said goodbye from me :)
    Lately post, but maybe helpful for others.

    Saturday, February 14, 2015 7:20 PM