我如何给出 C++编程一个图标?

发布于 2024-12-12 21:38:07 字数 53 浏览 3 评论 0原文

如何为我的 C++ 程序提供图标?我在 Ubuntu 11.10 上使用 g++ 进行编译。

How do I give my C++ program an icon? I'm compiling using g++ on Ubuntu 11.10.

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

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

发布评论

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

评论(3

幸福不弃 2024-12-19 21:38:07

在 Linux 上,可执行文件没有图标。您需要创建一个 .desktop 文件,您可以为该文件提供图标。例如,请参阅此处

在 Windows 上,您可以使用资源文件为文件本身提供图标。请参阅此处,特别是此处 获取说明。

On Linux, executables don't have icons. You need to create a .desktop file which you can give an icon. See here for example.

On Windows, you can use resource files to give the files themselves an icon. See here and especially here for an explanation.

为你拒绝所有暧昧 2024-12-19 21:38:07

除了 rubenvb 和 Joe McGrath 已经说过的内容之外,请注意,对于 Windows,您想要显示为应用程序默认图标的图标必须首先出现在资源文件中(即在任何其他图标之前)。

In addition to what rubenvb and Joe McGrath have already said, note that with Windows, the icon you want to show up as the application's default icon must occur first (i.e. before any other icons) in the resource file.

请止步禁区 2024-12-19 21:38:07

在 Windows 上,您可以自行将图标包含在可执行文件中。有些程序可以将资源添加到文件中。添加资源的不是编译器。

在 Linux 上,它不是在可执行文件本身中完成的。之前已在此处回答过

On Windows you can include the icon in the executable yourself. There are programs that add resources to the file. It is not the compiler that adds the resources.

On Linux it is not done in the executable itself. Was answered previously at here

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