我如何给出 C++编程一个图标?
如何为我的 C++ 程序提供图标?我在 Ubuntu 11.10 上使用 g++ 进行编译。
How do I give my C++ program an icon? I'm compiling using g++ on Ubuntu 11.10.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在 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.
除了 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.
在 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