T_T
T_T

Reputation: 583

LNK1000: Internal error during IMAGE::BuildImage

I have a problem with linking in VC++ 2010. When I compile in the debug mode it's ok, but in the release mode I regular receive the error "LNK1000: Internal error during IMAGE::BuildImage".

What am I doing wrong?

Upvotes: 11

Views: 15682

Answers (4)

terwxqian
terwxqian

Reputation: 659

In vs2019 it works for me:
Project->Property pages->Optimization->Link Time Code Generation, change from "Use Link Time Code Generation" to "Profile Guided Optimization-Instrument"

Upvotes: 1

okainov
okainov

Reputation: 4654

April 2020 update

Issue with MSBuild and Docker for Windows was fixed in MSBuild 16.5 (source), so if still seeing that - just update MSVS/MSBuild to the latest version

Original answer

Check for working C compiler: C:/BuildTools/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe -- broken
CMake Error at C:/Program Files/CMake/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:60 (message):
  The C compiler

    "C:/BuildTools/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe"

  is not able to compile a simple test program.
......

LINK : fatal error LNK1000: Internal error during IMAGE::BuildImage.FinalPhase

I was getting this error when I was running cmake in Docker for Windows inside mounted Docker volume. Solution is to copy the workspace to local Docker filesystem.

Upvotes: 1

Mugurel
Mugurel

Reputation: 41

I encountered the same error. The problem in my case was that I was "playing" with the configuration properties (Project Properties -> Configuration Properties -> General)

The 'Configuration Type' of the project was 'Dynamic Library (.dll)', but the 'Target Extension' was .lib instead of .dll.

Upvotes: 4

T_T
T_T

Reputation: 583

It began work as soon as I have changed "Whole program optimization" option from "Use Link Time Code Generation" to "Profile Guided Optimization-Instrument".

Upvotes: 10

Related Questions