从VS2010升级到VS2017时出现链接器错误 [英] Linker error when upgrading from VS2010 to VS2017

查看:251
本文介绍了从VS2010升级到VS2017时出现链接器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

使用VS2017构建DLL时,我得到一个未解决的外部符号错误,我在VS2010中没有得到。具体来说,链接器无法在函数_MapViewOfFile2中找到符号&_bsp imp_MapViewOfFileNuma2 @ 36。代码本身不使用
使用MapViewOfFile2或MapViewOfFileNuma2,但它们显然是由代码使用的一个WIN32函数直接或间接调用的。

When building a DLL using VS2017, I get an unresolved external symbol error that I did not get in VS2010. Specifically, the linker is unable to find symbol __imp__MapViewOfFileNuma2@36 referenced in function _MapViewOfFile2. The code itself does not use either MapViewOfFile2 or MapViewOfFileNuma2, but they are apparently invoked directly or indirectly by one of the WIN32 functions used by the code.

根据

https://msdn.microsoft.com/en-us/library/windows/desktop/mt492558%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396

https://msdn.microsoft.com/en-us/library/windows/desktop/mt492558%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396

在安装了Windows 10的PC上的库Kernel32.lib和DLL Kernel32.dll中找到MapViewOfFileNuma2。

MapViewOfFileNuma2 is found in library Kernel32.lib and DLL Kernel32.dll on PCs with Windows 10 installed.

我通过dumpbin / exports查看了kernel32.lib。输出的相关部分如下。

I looked at kernel32.lib via dumpbin /exports. The relevant part of the output is below.

转储文件C:\Program Files(x86)\ Windows Kits \10\lib\10.0.15063.0\\\\ x86\kernel32.lib

Dump of file C:\Program Files (x86)\Windows Kits\10\lib\10.0.15063.0\um\x86\kernel32.lib

...

                  _MapUserPhysicalPages @ 12

                  _MapUserPhysicalPagesScatter @ 12

                  _MapViewOfFile @ 20

                  _MapViewOfFileEx @ 24

                  _MapViewOfFileExNuma @ 28

                  _MapViewOfFileFromApp @ 20

                  _Module32First @ 8

                  _Module32FirstW @ 8

                  _MapUserPhysicalPages@12
                  _MapUserPhysicalPagesScatter@12
                  _MapViewOfFile@20
                  _MapViewOfFileEx@24
                  _MapViewOfFileExNuma@28
                  _MapViewOfFileFromApp@20
                  _Module32First@8
                  _Module32FirstW@8

...

我也看了在kernel32.dll文件中,该文件是安装了Windows 10的计算机的一部分。 dumpbin的相关输出是

I also looked at the kernel32.dll file that is part of the computer, which has Windows 10 installed. The relevant output from dumpbin is

转储文件C:\ Windows \ System32 \ kernel32.dll

Dump of file C:\Windows\System32\kernel32.dll

...

...

从这些输出看,  MapViewOfFileNuma2没有存在于kernel32.lib或作为Windows 10的一部分的kernel32.dll中,具有最新更新。我希望有任何建议让链接成功。 

As seen from these outputs, MapViewOfFileNuma2 does not exist in either kernel32.lib or the kernel32.dll that is part of Windows 10 with the latest updates. I would appreciate any suggestions to get the linking to succeed. 

Jim

推荐答案

您好JimMonte,

Hi JimMonte,

感谢您发布此处。

此论坛是关于Visual Studio IDE的,由于您的问题与C ++更相关,我们会帮助您将其移至正确的论坛以获得更好的支持。

This forum is about the Visual Studio IDE, as your issue is more related to the C++, we help you move it to correct forum for better support.

如果您有一些VS IDE问题,请随时与我们联系。我们将尽力为您提供解决方案。

If you have some VS IDE questions, please feel free to contact us. We will try our best to give you a solution.

感谢您的理解与合作。


这篇关于从VS2010升级到VS2017时出现链接器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆