question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

C1047 on bilinearspan.lib with current compiler

See original GitHub issue
  • .NET Core Version: 5.0.100, per global.json.
  • Windows version: Windows 10 build 21277.100.
  • Does the bug reproduce also in WPF for .NET Framework 4.8?: N/A, build-time issue.

Problem description

When I build my fork of WPF using the Release configuration, I see the error message listed below. (For some reason it works just fine in the Debug configuration.) I am using the MSVC compiler, version 19.28.29617, as included with Visual Studio 16.9.0 Preview 2.0.

Actual behavior

LINK : fatal error C1047: The object or library file 'C:\Users\William\.nuget\packages\runtime.win-x86.microsoft.dotnet
.wpf.dnceng\5.0.0-rtm.20560.4\runtimes\win-x86\native\bilinearspan.lib' was created by a different version of the compi
ler than other objects like 'D:\Projects\dotnet-wpf\artifacts\obj\wpfgfx\Win32\Release\precomp.obj'; rebuild all object
s and libraries with the same compiler [D:\Projects\dotnet-wpf\src\Microsoft.DotNet.Wpf\src\WpfGfx\core\dll\wpfgfx.vcxp
roj]
LINK : fatal error LNK1257: code generation failed [D:\Projects\dotnet-wpf\src\Microsoft.DotNet.Wpf\src\WpfGfx\core\dll
\wpfgfx.vcxproj]

Expected behavior

It should link.

Minimal repro

Checkout commit a6e62c39fab3f860a37c2f361fd225d52a982e4f from wjk/dotnet-wpf. Run build.bat -c Release -pack -bl. Observe the error.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ryalanmscommented, Jan 12, 2021

Even if the lib is compiled without whole program optimization, the linker will still fail with LTCG if the compiler versions are different.

1reaction
ryalanmscommented, Jan 11, 2021

I’ll close this when I see the darc flow from the int repo. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error C1047: Object file created with an older compiler than ...
This can happen if you begin using a new version of the compiler but do not do a clean rebuild of existing object...
Read more >
How do you "rebuild old objects and libraries"?
Hi all, first time posting here. I'm trying to run my project in Release mode, but I keep getting a C1047 error: The...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found