USER32.dll中缺少入口点会阻止程序启动,C ++,VS2015 [英] Missing entry points in USER32.dll stops program from launching, C++, VS2015

查看:252
本文介绍了USER32.dll中缺少入口点会阻止程序启动,C ++,VS2015的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Windows 10机器上使用 VS2015 (平台工具集v140,目标平台8.1)编写C ++程序,并且我的程序在Windows 7、8和10上运行良好,直到最近。



使用 GetPointerInfo() ,我在Windows 7计算机上执行后立即收到此弹出错误:


在USER32.dll中找不到名为GetPointerInfo的入口点


MS明确指出 GetPointerInfo()仅在Win8及更高版本上受支持,没关系,但是我不想完全破坏程序与Windows 7的兼容性。 / p>

我假定Windows 7版本的 USER32.DLL 根本不包含该功能,但在其中添加了运行时检查我的程序(即仅调用 GetPointerInfo() IsWindows8OrGreater()返回true)并不能解决问题。



实际上,仅使用任何程序编译我的程序引用 GetPointerInfo()会破坏Win7的兼容性,无论是否实际调用该函数。该程序甚至都不会输入 WinMain(),它只会向我抛出该消息并退出。



再次,在Windows 8及更高版本上,一切正常。



我该如何解决?



我有Google搜索了半天,但是对DLL,链接器和编译器设置的了解很少,我显然甚至不知道该如何用短语表达,因为到目前为止我已经空了。



我已经尝试将多线程(/ MT)和多线程DLL(/ MD)用作运行时库。



我也尝试启用并禁用功能级链接,但结果保持不变。

解决方案


我认为Windows 7是USER32.dll版本完全不包含该功能


那是正确的。


但在我的程序中添加运行时检查(即仅在IsWindows8OrGreater上调用GetPointerInfo)不会把戏。 :(


如果您在运行时动态加载函数,则可以使用链接器的延迟加载功能,或使用 GetProcAddress() 直接在您的代码中(链接器的延迟加载器使用 GetProcAddress()内部为您提供。)


实际上,仅编译我的程序任何引用GetPointerInfo的内容都会破坏Win7的兼容性,无论是否实际调用了该功能。


只有当您在编译时静态链接到该函数,而无需使用链接器的延迟加载功能。


I'm writing a C++ program using VS2015 (Platform Toolset v140, Target Platform 8.1) on a Windows 10 machine, and my program ran just fine on Windows 7, 8 and 10 up until recently.

After adding touch support using GetPointerInfo(), I get this pop-up error immediately on execution on Windows 7 machines:

Unable to find an entry point named GetPointerInfo in USER32.dll

MS clearly states that GetPointerInfo() is only supported on Win8 and up, and that's all right, but I don't want to break my program's compatibility with Windows 7 altogether.

I assume Windows 7's version of USER32.DLL doesn't containing the function at all, but adding runtime checks in my program (i.e. only calling GetPointerInfo() if IsWindows8OrGreater() returns true) doesn't do the trick.

In fact, merely compiling my program with any reference to GetPointerInfo() will break Win7 compatibility, no matter if the function is actually called or not. The program won't even enter WinMain(), it just throws me that message and quits.

Again, on Windows 8 and up, everything is working just fine.

How do I solve this?

I have Googled for half a day, but having very little knowledge of DLLs, linker and compiler settings, I obviously don't even know how to phrase my searches because I have come up empty so far.

I have tried both Multi-threaded (/MT) and Multi-threaded DLL (/MD) as my Runtime Library.

I have also tried enabling and disabling Function-Level Linking, but the result remains the same.

解决方案

I assume Windows 7's version of USER32.dll doesn't containing the function at all

That is correct.

but adding runtime checks in my program (i.e. only calling GetPointerInfo on IsWindows8OrGreater) doesn't do the trick. :(

It does if you load the function dynamically at runtime, either by using your linker's delay-loading feature, or using GetProcAddress() directly in your code (the linker's delay loader uses GetProcAddress() internally for you).

In fact, merely compiling my program with any reference to GetPointerInfo will break Win7 compatibility, no matter if the funcion is actually called or not.

That error happens only if you static-link to the function at compile-time without using the linker's delay-load feature.

这篇关于USER32.dll中缺少入口点会阻止程序启动,C ++,VS2015的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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