I am building a proxy/stub library from an IDL file, and for some reason, the build driver believes that the import library generated during the link is an input file to the link, causing the project to be relinked every time (path names shortened for readability):
10:05:33.764 1>
Target "Link: (TargetId:66)" in file "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets" from project "[...]\VersionControl.vcxproj" (target "_Link" depends on it):
Using "Link" task from assembly "Microsoft.Build.CppTasks.Win32, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "Link" (TaskId:26)
Write Tracking Logs: (TaskId:26)
[...]
Outputs for [...]\DEBUG\DLLDATA.OBJ|[...]\DEBUG\VERSIONCONTROL.DLL.EMBED.MANIFEST.RES|[...]\DEBUG\VERSIONCONTROL_I.OBJ|[...]\DEBUG\VERSIONCONTROL_P.OBJ: (TaskId:26)
[...]\DEBUG\VERSIONCONTROL.ILK (TaskId:26)
[...]\DEBUG\VERSIONCONTROL.DLL (TaskId:26)
[...]\DEBUG\VERSIONCONTROL.DLL.INTERMEDIATE.MANIFEST (TaskId:26)
[...]\DEBUG\VERSIONCONTROL.PDB (TaskId:26)
Inputs for [...]\DEBUG\DLLDATA.OBJ|[...]\DEBUG\VERSIONCONTROL.DLL.EMBED.MANIFEST.RES|[...]\DEBUG\VERSIONCONTROL_I.OBJ|[...]\DEBUG\VERSIONCONTROL_P.OBJ: (TaskId:26)
[...]\LIB\RPCRT4.LIB (TaskId:26)
[...]\LIB\KERNEL32.LIB (TaskId:26)
[...]\LIB\USER32.LIB (TaskId:26)
[...]\LIB\GDI32.LIB (TaskId:26)
[...]\LIB\WINSPOOL.LIB (TaskId:26)
[...]\LIB\COMDLG32.LIB (TaskId:26)
[...]\LIB\ADVAPI32.LIB (TaskId:26)
[...]\LIB\SHELL32.LIB (TaskId:26)
[...]\LIB\OLE32.LIB (TaskId:26)
[...]\LIB\OLEAUT32.LIB (TaskId:26)
[...]\LIB\UUID.LIB (TaskId:26)
[...]\LIB\ODBC32.LIB (TaskId:26)
[...]\LIB\ODBCCP32.LIB (TaskId:26)
[...]\DEBUG\VERSIONCONTROL.DLL.EMBED.MANIFEST.RES (TaskId:26)
[...]\DEBUG\DLLDATA.OBJ (TaskId:26)
[...]\DEBUG\VERSIONCONTROL_I.OBJ (TaskId:26)
[...]\DEBUG\VERSIONCONTROL_P.OBJ (TaskId:26)
[...]\SYSTEM32\TZRES.DLL (TaskId:26)
[...]\SORTING\SORTDEFAULT.NLS (TaskId:26)
[...]\DEBUG\VERSIONCONTROL.EXP (TaskId:26)
[...]\DEBUG\VERSIONCONTROL.LIB (TaskId:26)
[...]\VERSIONCONTROL.DEF (TaskId:26)
[...]\LIB\MSVCRTD.LIB (TaskId:26)
[...]\LIB\OLDNAMES.LIB (TaskId:26)
Source compilation required: input [...]\DEBUG\VERSIONCONTROL.LIB is newer than output [...]\DEBUG\VERSIONCONTROL.DLL. (TaskId:26)
The project is set up as a normal DLL project, with settings left as defaults. Any idea why MSBuild decides that these generated files should be treated as inputs, and how I could fix this?
This is a shot in the dark, but worth a look…
Open up your vcxproj file and look for the @(Midl) item. Modify it by trying one of these three pieces of item metadata and see how the behavior changes, it may put you on the right path: