我只是使用Visual Studio 2015创建了一个C ++ DLL。我没有对默认源进行任何编辑。然后,我使用DependencyWalker查看了我所有的DLL依赖关系,然后看到了:
您可以清楚地看到所需的大多数dll都丢失了。
当我尝试连接到这样的dll时,我收到那些缺少的库的错误消息...
我尝试连接到CodeBlocks中制作的DLL,但它没有给我任何错误。
这是怎么回事 ?
PS:
这是错误消息:
该程序无法启动,因为您的计算机缺少MSVCP140_APP.dll。请尝试重新安装该程序以解决此问题。
我的问题的更多信息可以在这里看到:
您的问题由两部分组成。
您可以清楚地看到所需的大多数dll都丢失了。
api-ms-win-*
family of modules, introduced with Windows 7, consists of tiny stub DLLs that redirect function calls inside core libraries (such as kernel32
, user32
etc.) to their implementations elsewhere.
They are not really missing, it's just Dependency Walker is ridiculously out of date (latest version dates back to year 2006) and doesn't know where to search. In fact, you can inspect any successfully running windows binary that links to system libraries and see the very same picture.
api-ms-win-*
it's an internal details of Windows implementation and you shouldn't worry about it, unless you are working at Microsoft in Windows kernel team.
When I try to connect to such a dll I get error for those libaries missing... I tried connecting to a DLL made in CodeBlocks and it didn't give me any errors.
Visual C++ -> DLL (Universal Windows)
Visual C++ -> Win32 Project
You are mixing Win32 application (uses good 'ol Win32 API) and Universal Windows Platform libary (that what was Windows RT before).
Instead you should either:
(the Win32 way) create a usual Win32 DLL, by using Visual C++ -> Win32 Project
template and then choosing Application type: DLL
and then link it with your Win32 App.
(the WinRT way) create a Universal Windows App to link against Universal Windows DLL
Code blocks works here because it does not (and will probably never) support UWP.
P.S. You should never explicitly link against VCRUNTIME140_APP.dll
or worse api-ms-win-*.dll
unless you know what you are dong.
PPS说实话,您可以以有限的方式混合使用UWP和Win32。但让我们将其称为高级主题,并留给好奇的读者作为练习。
链接:
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句