fatal error C1900: Il mismatch between 'P1' version '20060201' and 'P2' version '20050411' RRS feed

  • Question

  • hi,

    Im running Microsoft Visual Studio C++ 2005 Express Edition on Windows XP. Recently, the application stopped working for me, all I get now when compiling my previously working project is:

    > fatal error C1900: Il mismatch between 'P1' version '20060201' and 'P2' version '20050411'
    >LINK : fatal error LNK1257: code generation failed

    Ive tried uninstalling and reinstalling the software but to no avail. If anybody has any hints on what might cause this problem, I would greatly appreciate it.

    Eirik F
    Tuesday, April 24, 2007 8:56 AM

All replies

  • Strange problem, looks like you have a version mismatch between the pass1 and the pass2 compiler modules (vc\bin\c1.dll and c2.dll).  The dates don't look right; April 11th, 2005 looks about right for the original version.  Feb 1st 2006 is too new for SP1, it should be around Dec 6th, 2006.  Both files should definitely have the same date.

    Guessing: you installed the wrong service pack, possibly the Vista version instead of the Express version.
    Tuesday, April 24, 2007 12:57 PM
  • hi,

    thanks for your answer. Installing Visual C++ 2005 Express SP1 made the above described problem go away: Only to give me a new one. My company has developed a well used and tested C++ code that runs OK in Visual C++ 2005 Express (with and without the SP1-upgrade of Visual Studio 2005 Express installed) on our Windows 2000 machines. We have also some developer Windows XP-machines, and we have not been able to make the code run on any of these. On some of our XP-machines the Visual C++ Express simply refuses to start load the project file and chrashes with "Visual Studio encountered a problem and needs to close". On some XP, it helps to upgrade to the C++ 2005 Express SP1. Then the project-file loads and the code compiles. On execution it chrashes badly however with a "buffer overrun". I have reduced the problem to the following: I insert the following three lines of code at the start of main-loop:

    int main(int argc, char* argv[])
    std:Tongue Tiedtring str = "Hello"
    std::vector<std:Tongue Tiedtring> strArray;
    strArray.push_back( str );



    Then the code chrashes with "buffer overrun" on the push_back line above.  Mysterious. I guess we will have to replace our developer Win-XP machines with Win-2000 because of this problem. Unless Vista works better with Visual C++, but I wouldnt bet on it.

    Eirik Fossgaard
    Friday, May 4, 2007 8:08 PM
  • Mysterious indeed. Especially since that sample 3 lines works with no problem. Maybe a reinstall of your VC will help?
    Friday, May 4, 2007 8:19 PM
  • Yah, your original issue was a pretty gross installation problem.  You didn't tell us how that happened.  Without that info, I can only recommend you uninstall *everything* and re-install.
    Friday, May 4, 2007 9:32 PM
  • hi,

    Ive tried uninstalling and reinstalling. Several times. As I write this, I just finished another uninstall/reinstall. Now I have the P1 != P2 problem at the linking stage as reported before. I know how to get rid of that: Install the C++ 2005 Express SP1 upgrade pack. But then Im back to the code chrashing as explained above. I checked some of the system header files, they have been modified in SP1 (xutility.h and several more headers). And since Im able to reproduce this whole scenario on several different PCs running Windows XP, Im inclined to think that the problem has something to do with the interplay between Win XP and Visual C++ 2005 Express. Because on Win 2000 it works for me and Ive not been able to reproduce this problem on Win 2000 at all. So maybe the easiest "solution" is to wipe out Win XP on my new laptop and replace it with Win 2000. But of course I know everything code and OS-technical problem like this has a natural explanation. But to pin it down in Windows is a time-consuming nightmare for non-experts like me. Im just a scientist ;-)

    Eirik Fossgaard
    Friday, May 4, 2007 10:54 PM
  • Hi Eirik,


    could you solve your problems now? I ask because we have currently the same problems in our lab. I use Win XP SP2 with VS2005 Professional. On one machine with VS2005 SP1 we have exceptions with vector<string>, too (in Release Code). On another machine without SP1 we have exactly the same Linker error (P1 != P2). Currently I install SP1 to see if the linker error disappears, but the vector<string> problems are very, very strange and we debug since 2 days to find out that reason. Do you use 4 or 8 byte alignment in compile settings? Do you link with some C++ libs that have classes with vector<string> members? I assume that this is a linker problem, too, but we currently can not prove it with a small example.

    If you have a small vector<string> sample that does not work, I could try it on our machines. Maybe we can track down that problem together.






    Saturday, December 15, 2007 12:09 AM
  • Hi,


    the vector<string> problem is solved. In one library project there was the preprocessor macro _SECURE_SCL=0 defined. This causes the STL to push more or less parameters to the stack. These parameters of course are not consistent with the parameters used by the other libraries and this leads to very courious effects.






    Monday, December 17, 2007 2:23 PM
  • I recently encountered the same error running VS2005/Server 2003 x64 (in a 32 bit mode).  The issue was resolved after upgrading to VS2005 SP1.


    Tuesday, February 5, 2008 4:51 PM
  • Got the same problem.

    It is probably caused by linking with a library that is compiled with another version of Visual Studio.


    Tuesday, July 15, 2008 8:54 AM
  • I am facing this problem and try to solve for the whole day.Pls let me know how to get rid of this problem.

    Monday, September 22, 2008 1:36 PM
  • Hi,

    The problem is simple to be solved.
    The VS solution file where in your source code is, would have been using a library compiled by some other version of VS.

    Get the source code from which particular library is generated, compile it to produce the new lib file using the version of VS that is currently running in your machine.
    Use that *.lib file to be linked to your final solution.

    The error gets eliminated.

    Monday, November 30, 2009 5:13 AM
  • Hi,


    what if I don't have access to the source codes for the problem libraries? Is there any alternative to this?

    Monday, April 19, 2010 9:17 AM
  • I solved the problem by installing the SP1. It is still confusing for me why this error appears.

    If someone has an explanation then please let us know.



    Monday, April 19, 2010 11:16 AM
  • Hello,

    I'm getting the same error. Please reply, where are those linkers and how could they differ between P1 & P2 ?


    Friday, January 7, 2011 5:40 PM