现象:
每次选择 重新生成,就会出现上述错误。
然后选择 生成,正常生成。
解决:改成否就可以了
原因:
What I'm seeing is that, when the map file doesn't exist, the link fails with that exact error message, and a zero-byte map file is created. That zero-byte map file will prevent the error on the next build, but it doesn't help for the next rebuild since the map file is deleted.
I've also discovered that incremental linking has to be enabled for this to occur.
The original report doesn't say the link fails "when a map file exists in the folder", it just says "in the obj32-Folder there is a map file of 0 size." It doesn't say whether that's before or after the failed link.
The machine I'm testing this on doesn't have any real-time AV scanning.
Here is the link command lnie, according the Linker->Command Line property page.
/OUT:"..\WinDebug\Module.dll" /INCREMENTAL /NOLOGO /LIBPATH:"..\WinDebug\Lib" /DLL "msxml2.lib" "version.lib" /MANIFEST /ManifestFile:"./WinDebug\Module.dll.intermediate.manifest" /ALLOWISOLATION /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"..\WinDebug\PDB\Module.pdb" /MAP":..\WinDebug\ASM\Module\Module.map" /MAPINFO:EXPORTS /SUBSYSTEM:WINDOWS /PGD:"C:\Projects\vs2010\WinDebug\Module.pgd" /TLBID:1 /DYNAMICBASE:NO /IMPLIB:"..\WinDebug\LIB\Module.lib" /MACHINE:X86 /ERRORREPORT:QUEUE
Also, the output window shows the "creating library" line twice when this happens. And in Process Monitor, I can see there are three PIDs involved for LINK.EXE (and I'm only building one project). It seems like, at one point, two different instances of LINK.EXE are launched that both try to open the map file.