VS2010 LNK1104 无法打开.map

现象:

每次选择 重新生成,就会出现上述错误。

然后选择 生成,正常生成。

解决:改成否就可以了

原因:

https://social.msdn.microsoft.com/Forums/en-US/19804537-05ba-4adf-8273-68d2450401e0/build-failes-if-map-file-should-be-generated?forum=vcprerelease

扫描二维码关注公众号,回复: 10242126 查看本文章

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.

发布了104 篇原创文章 · 获赞 44 · 访问量 12万+

猜你喜欢

转载自blog.csdn.net/u012138730/article/details/90549717