单个 wxWidgets MSW 应用程序二进制文件是否兼容 Win2K、XP、Vista 和 7?

发布于 2024-08-22 05:23:47 字数 323 浏览 2 评论 0原文

wxWdgets 是一个跨平台库,包括对所有主要 Windows 版本的支持,但我在 wxWidgets 文档中找不到任何有关 单个 MSW(Windows)构建的可移植性的内容跨不同 Windows 版本的 wxWidgets 库。假设我的核心应用程序只使用除了 wx 函数之外的普通 C++(也许是所有平台上可用的 win32 api 的最小公分母),则静态链接到单个版本的 wxWidgets 库会生成一个可以在 Win2K、XP 上运行的二进制文件, Vista 和 Windows 7?该库是否需要构建在 win2K(“功能最少”的平台?)上,或者在 XP 上构建它也可以工作?任何提示或指示将不胜感激!

wxWdgets is a cross-platform library that includes support for all the major windows versions, but I can't find anywhere in the wxWidgets documentation that says anything about the portability of a single MSW (windows) build of the wxWidgets library across different windows versions. Assuming my core app just uses vanilla C++ (and perhaps the least common denominator of win32 apis available on all platforms) except for wx functions, would linking statically against a single version of the wxWidgets library produce a binary that would run across Win2K, XP, Vista, and windows 7? Would that library need to be built on win2K (the "least featureful" platform?), or would building it on XP also work? Any hints or pointers would be appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

如歌彻婉言 2024-08-29 05:23:47

您可以在任何您想要的操作系统版本上构建应用程序,这不会影响应用程序与不同Windows版本的兼容性。您甚至可以在另一个操作系统上交叉编译 Windows 应用程序。

重要的是应用程序引用的 API 调用的选择。加载时链接的任何函数都需要存在于操作系统中,而延迟加载的库或 API 函数不会影响兼容性,只要应用程序妥善处理错误即可。

稳定的 wxWidgets 版本 2.8 至少与 Windows 2000 和所有更高版本兼容(如果您使用库的非 Unicode 版本,您甚至可以针对 Windows 9X),它会延迟加载 Windows 2000 中不可用的所有功能(例如示例主题支持,随 XP 引入)。您可以确定应用程序可以运行,但有些功能可能无法在 Windows 2000 上运行(例如透明 PNG)。

开发环境可能会施加额外的最低操作系统版本要求。例如,较新的 Visual C++ 版本可能需要在较旧的操作系统版本上安装 C 运行时,并且可能有最低支持版本。然而,这与程序中是否使用 wxWidgets 无关。

You can build the application on any OS version you want, this doesn't affect the application compatibility with different Windows versions. You can even cross-compile Windows applications on another OS.

The important thing is the selection of API calls that the application references. Any functions linked at loadtime need to be present in the OS, while libraries or API functions that are delay loaded don't affect the compatibility, as long as the application handles the errors gracefully.

The stable wxWidgets version 2.8 is compatible with at least Windows 2000 and all later versions (you could even target Windows 9X if you use the non-Unicode build of the library), it delay loads all functions that are not available in Windows 2000 (for example theme support, introduced with XP). You can be sure that the application runs, but there may be things that don't work on Windows 2000 (for example transparent PNGs).

There may be additional minimum OS version requirements imposed by the development environment. Newer Visual C++ versions for example may require the C runtime to be installed on older OS versions, and there may be a minimum supported version. This however is independent of wxWidgets being used in the program or not.

挖鼻大婶 2024-08-29 05:23:47

是的,wx 二进制文件可以在 XP--7 范围内移植(如果您不使用 Unicode 或使用 MSLU,那么相同的二进制文件也应该在 95 年以前的系统上写入,但现在很少有人使用这些文件(值得庆幸的是),这可能会导致实际上在没有人注意到的情况下就被破坏了)。 wxWidgets 动态加载所有 Windows 版本上的系统 DLL 中不存在的任何函数,即通过 GetProcAddress(),并为旧系统使用合理的回退。

Yes, wx binaries are portable across XP--7 range (and the same binary should also write on systems as ancient as 95 if you don't use Unicode or use MSLU but so few people use those nowadays (thankfully) that this might have actually got broken without anybody noticing). wxWidgets loads any functions not present in the system DLLs on all Windows versions dynamically, i.e. via GetProcAddress(), and uses reasonable fallbacks for the older systems.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文