Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

binary is incompatible after update of VisualStudio 2017 #157

Closed
igagis opened this issue Aug 18, 2017 · 18 comments
Closed

binary is incompatible after update of VisualStudio 2017 #157

igagis opened this issue Aug 18, 2017 · 18 comments
Labels

Comments

@igagis
Copy link
Contributor

igagis commented Aug 18, 2017

After update of Visual Studio 2017 from version 15.0 to 15.3 I started getting the following errors:

LINK : fatal error C1047: The object or library file 'C:\projects\build\msvs_solution\packages\pugixml.1.8.3\build\native\lib/Win32\v141\dynamic\Release\pugixml.lib' was created with an older compiler than other objects; rebuild old objects and libraries [C:\projects\build\msvs_solution\render_test\render_test.vcxproj]

you can find the build log of my project here https://ci.appveyor.com/project/igagis/svgren/build/master-395

Looks like the pugixml nuget package has to be rebuild with latest VS2017.

@zeux
Copy link
Owner

zeux commented Aug 18, 2017

Ugh. Apparently

C1047 is caused when object files or libraries built with /LTCG are linked together, but where those object files or libraries are built with different versions of the Visual C++ toolset.

So I'll have to disable LTCG and rebuild pugixml to avoid version conflicts (if I just rebuild with the latest VS2017 that will presumably break compatibility with 15.0).

@zeux zeux added the build label Aug 18, 2017
@zeux
Copy link
Owner

zeux commented Aug 18, 2017

@igagis I've uploaded new package version 1.8.4; it still works with VS2017 15.0 - can you check if it fixes the build with 15.3?

@igagis
Copy link
Contributor Author

igagis commented Aug 18, 2017

Unfortunately, still does not work:

https://ci.appveyor.com/project/igagis/svgren/build/master-396

@zeux
Copy link
Owner

zeux commented Aug 18, 2017

The build you linked is still using 1.8.3:

GET https://www.nuget.org/api/v2/Packages(Id='pugixml',Version='1.8.3')

You'll have to switch to 1.8.4 in packages.config.

edit wait, never mind - it is using 1.8.4. Hmm...

@igagis
Copy link
Contributor Author

igagis commented Aug 18, 2017

Nope, it does nuget update afterwards, check the log further, it updates to 1.8.4, and the very last line with error also says 1.8.4

@zeux
Copy link
Owner

zeux commented Aug 18, 2017

This is interesting... Do you know if AppVeyor "Visual Studio 2017" got updated to 15.3 or are you using some special setup for this? It's odd since I'm building NuGet package with "Visual Studio 2017" image so I would think that if the issue was with 15.3 then the new build would have resolved the problem regardless of whether my project file change helped...

@igagis
Copy link
Contributor Author

igagis commented Aug 18, 2017

I think it was updated to 15.3 a day ago or so, I started getting these errors without relevant changes, so I think it is because it was updated. I also updated VS on my PC and those errors also appeared when building on my machine.
Also, in the log you can find 15.3:
https://ci.appveyor.com/project/igagis/svgren/build/master-396#L1193

@igagis
Copy link
Contributor Author

igagis commented Aug 18, 2017

Maybe I also need to turn off optimizations in my project files...

@zeux
Copy link
Owner

zeux commented Aug 18, 2017

I think the issue might be that pugixml VS2017 build is not built properly - maybe it's built using VS2015, at least I'm seeing a path to Visual Studio 14.0 CL.exe in the resulting .lib file for some reason. I'll have to investigate this a bit more.

@zeux
Copy link
Owner

zeux commented Aug 18, 2017

Ah ugh nuget_build.ps1 has a typo :( so yeah the "VS2017" build is actually VS2015 build that still has LTCG enabled.

@igagis
Copy link
Contributor Author

igagis commented Aug 18, 2017

Ah, I see, let's hope it will fix it :)

@igagis
Copy link
Contributor Author

igagis commented Aug 18, 2017

and most likely it is not LTCG is guilty but that it is built with v140 tools instead of v141

@zeux
Copy link
Owner

zeux commented Aug 18, 2017

Yeah I'm trying to rebuild with LTCG enabled but with correct toolset this time.

@zeux
Copy link
Owner

zeux commented Aug 18, 2017

Yeah, nah, here's what I get with LTCG enabled, VS2017 15.3 (AppVeyor) used to compile pugixml.lib, and VS2017 15.0 (local machine) used to link against it:

lib/x64/v141/dynamic/Release/pugixml.lib
pugixml.lib(pugixml.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to impro
ve linker performance
Microsoft (R) Incremental Linker Version 14.10.25019.0
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:pugixmltest.exe
pugixmltest.obj
lib/x64/v141/dynamic/Release/pugixml.lib
fatal error C1900: Il mismatch between 'P1' version '20161212' and 'P2' version '20150812'
LINK : fatal error LNK1257: code generation failed

@igagis
Copy link
Contributor Author

igagis commented Aug 18, 2017

The other strange thing actually is how was it working before if it was built with v140 tools, while I was using v141 in my projects...

@zeux
Copy link
Owner

zeux commented Aug 18, 2017

My guess is that 15.0 used the same IL format as VS2015, but 15.3 bumped it which started causing these mismatches. The fact that this makes LTCG binaries incompatible between 15.0 and 15.3 is pretty annoying.

I've uploaded package 1.8.5 which should hopefully resolve this (has LTCG disabled and is actually using VS2017...).

@igagis
Copy link
Contributor Author

igagis commented Aug 19, 2017

Now it works! Thank you for help!

@igagis igagis closed this as completed Aug 19, 2017
zeux added a commit that referenced this issue Aug 20, 2017
Due to a typo in build script v141 binaries were built using VS2015
instead of VS2017.

Fixes #157.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants