dotnet / msbuild

The Microsoft Build Engine (MSBuild) is the build platform for .NET and Visual Studio.
https://docs.microsoft.com/visualstudio/msbuild/msbuild
MIT License
5.17k stars 1.34k forks source link

MSBuild c++ error link1112 #7918

Open VEGAXS opened 1 year ago

VEGAXS commented 1 year ago

Is there an existing issue for this?

Describe the bug

I am making a blueprint compiler, I am going to try to use MSBUILD to compile and test, running the compilation in the default x64 output folder of vs is 100% working, but when I migrate to the desktop, the error of Link1112 appears, I don't understand, why Migrating to other places will not work. The way I compile is to get the folder below the root directory of the output exe and automatically add the path to the system variable image image image image image image work image error image

Expected Behavior

No response

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

No response

Anything else?

No response

yuehuang010 commented 1 year ago

The error suggest that you are mixing compiler. Either the intermedia file are mixing or the compiler itself. Check 1) Are you copying the OBJ between machines? 2) The build can produce an intermediate PDB named vc14X.pdb, are these mixing? 3) compiler bitness mixing? 4) /MACHINE:xxx flag are consistant between compiler and linker?

As a side note, don't use "endl" on filestream. endl will flush to disk on each call and lead to bad perf. Use "\n" instead.