适用于 Win/Linux/Mac 的 C++ 纯 GUI 应用程序与 G++

发布于 2024-09-28 13:14:28 字数 680 浏览 1 评论 0原文

使用 C/C++ 编写的适用于 Win/Linux/Mac 的 GUI 应用程序:

我想知道如何编写”、“本机” >" “API 级 适用于 Windows、Linux 和 Mac 的 C++ 应用程序。

我不想要“一个代码在任何地方运行”,而是每个操作系统的本机代码。


Windows解决方案:

只需使用Mingw/Win32 API;这非常简单明了。这样我就喜欢在Windows下编程了。


Linux 解决方案:

例如,如果我使用 wxWidgets-dev/GNU G++,如果用户不安装<,我的应用程序就无法在 PC/Linux 上运行<代码>wxWidgets?如果没有,我如何在我的程序中包含 wxWidgets 库?


Mac 解决方案:

Objective-C++/GNU G++ 是解决方案吗?或者Carbon/C++/GNU G++ 是解决方案吗?

GUI apps for Win/Linux/Mac in C/C++:

I want know how to write a "pure," "native," "API-level" apps for Windows, Linux, and Mac in C++.

I don't want "one-code run-anywhere", but native code for every OS.


Solution For Windows:

Just use Mingw/Win32 API; it's very simple and clear. That way I like programming under Windows.


Solution For Linux:

If I use, for example, wxWidgets-dev/GNU G++, my application can't run on PC/Linux if the user doesn't install wxWidgets? If not, how do I include the wxWidgets library in my program?


Solution For Mac:

Is Objective-C++/GNU G++ is the solution? Or is Carbon/C++/GNU G++ the solution?

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

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

发布评论

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

评论(1

夜唯美灬不弃 2024-10-05 13:14:28

Mac

在 Mac 情况下,您只需启动 XCode 并使用 Objective-C。 Objective-C++ 主要用于让您从 Objective-C 访问现有的 C++ 库。

不要使用 Carbon,它已被弃用。它只是为了让从 Mac OS 9 的移植变得更容易。

Linux

这一项很困难,因为实际上没有任何保证。您可以非常确定 X Windows 将会在那里,但是有各种各样的库(Gnome、KDE、WxWidgets、FLTK、Motif 等)可能可用,也可能不可用。

在过去,您可以期望 Athena 小部件可用,因为它们随 X Windows 一起提供,但它们看起来很糟糕(介于 Mac OS 3 和 Palm OS 1 之间),几乎没有人愿意再使用它们。

因此,您几乎必须选择一个库/工具包并使用它,并期望您的用户安装它。如今,大多数发行版都使依赖项的安装变得非常容易,因此它并不像在 Windows 上安装 wxWidgets 那样烦人。

Mac

In the Mac case, you'll just want to fire up XCode and use Objective-C. Objective-C++ is mostly used to let you access existing C++ libraries from Objective-C.

Don't use Carbon, it's deprecated. It was only intended to make porting from Mac OS 9 easier.

Linux

This one is tough because there's really no guarantee of much of anything. You can be pretty sure that X Windows will be there, but there's a whole variety of libraries (Gnome, KDE, WxWidgets, FLTK, Motif, etc.) that may or may not be available.

In the old days, you could expect Athena widgets to be available, since they shipped with X Windows, but they look so crappy (somewhere between Mac OS 3 and Palm OS 1) that hardly anyone wants to use them any more.

So you pretty much have to pick a library/toolkit and use it, and expect your users to install it. Most distros make installation of dependencies really easy these days, so it's not as annoying as, say, installing wxWidgets on Windows.

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