houzhe
houzhe

Reputation: 13

Why Visual Studio generates two versions of Obj?

I use Visual studio 2010 to compile a solution. An error is reported that

The object or library file ... was created with an older compiler than other objects; rebuild old objects and libraries.

Then I disable /GL on the concerned lib project as workaround, but another error is reported that

Il mismatch between 'P1' version '20100826' and 'P2' version '20081201'

I checked framework and platformtoolset, all projects are same (4.0 & v100). How visual studio compiled two versions of obj? Any good way to remove this compile error?

Upvotes: 1

Views: 1014

Answers (1)

harper
harper

Reputation: 13690

Probably you have changed the configuration of the project. Changed path names are a good candidates. Consider these steps

  • Clean the project from the Visual Studio menu
  • Delete any .obj file from the Windows Explorer
  • Build again.

If this doesn't help, enable verbose linker output and check what files are actually linked.

Upvotes: 3

Related Questions