Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Il mismatch between 'P1' version '20080116' and 'P2' version '20070207'

I am building MFC application which uses other c++ library.I am using vs 2008 and compiled all the library project in vs 2008.

It is compiling well in debug mode but failed to run in Debug Unicode mode,Release,Release Unicode mode.

I found in the net that VS 2008SP1 is required to be installed but how come it is compiling in debug mode.

Please suggest how to overcome this problem.

like image 448
Vikram Ranabhatt Avatar asked Jan 22 '12 08:01

Vikram Ranabhatt


2 Answers

If compiling a solution with multiple projects you should compile all projects with the same compiler (version) to be sure it works.

I once got the same error message like you. If I remember correctly the problem occured because link time code generation was used. My solution was to rebuild all, another solution might have been disabling link time code generation.

like image 183
Werner Henze Avatar answered Nov 10 '22 15:11

Werner Henze


In Microsoft terminology, P1 is the parser (front-end), and P2 is the code generator (back-end). With link-time code generation (LTGC) enabled, the result of P1 is stored in a file and P2 is performed later at link time.

If you downgraded your compiler, you should do a full rebuild, otherwise the link step will try to use the incompatible P1 output, which will trigger that error.

If you upgraded the compiler, Visual Studio automatically does a full rebuild, so this should never happen (if it does anyway, just perform a full rebuild).

like image 23
rustyx Avatar answered Nov 10 '22 16:11

rustyx