MSBuild repeatedly re-links executable

Pavel Kostromitinov 1 Reputation point
2022-09-13T16:10:59.387+00:00

I have a project (generated by cmake), without any other project dependencies.
And each time I run build from command line, executable is being relinked. However, when building the same project from VStudio, it only links once.
I have generated detailed MSBuild log, and immediately before link command there is such diagnostic:

Source compilation required: input is newer than output .

As if there is an empty file name somewhere in the inputs...
It actually happen with every executable in the solution. What could possibly cause this?

240685-output.log

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,001 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Michael Taylor 48,281 Reputation points
    2022-09-13T17:53:47.687+00:00

    Just taking a look at the log file, when it compiles rcedit it is looking for the C_1252.nls file. That file isn't being found so it triggers a build of the project with the assumption that the project is creating it. Because it recompiled the project the input to link is newer than what was there before so it relinks.

    You should identify why the NLS file is not available and ensure it exists before compilation.

    0 comments No comments

  2. Pavel Kostromitinov 1 Reputation point
    2022-09-13T19:45:01.41+00:00

    This is by no means a dependency mentioned anywhere in the project file, looks more like something auto-added by MSBuild.

    0 comments No comments

  3. Pavel Kostromitinov 1 Reputation point
    2022-09-13T19:48:40.06+00:00

    After some experimenting, I surprisingly found out that only x86 MSBuild produces this behavior. x64 MSBuild doesn't have any problems, neither it mentions C_1252.NLS...

    240742-output64.log