将图标添加到 gcc 可执行文件并在终端中打开

发布于 2024-08-30 01:20:14 字数 183 浏览 4 评论 0原文

我编写了一个程序,通过蓝牙连接到设备,并使用 gcc 中的纯 C 将数据发送到网络。我现在无法在代码中实现任何 GUI 部分,但我需要将其部署到测试用户进行测试。我想要带有图标的可执行文件,以便用户可以单击可执行文件并且程序在终端中启动。如何向可执行文件添加图标并在终端中启动程序?

抱歉我之前没有提到它在 Ubuntu Linux 中

I made a program to connect to a device via Bluetooth and send the data to the web using pure C in gcc. I won't be able to implement any GUI portion in the code right now but I need to deploy it to test users for testing. I want to have the executable with an icon so that a user can click on the executable and the program starts in the terminal. How do I add an icon to the executable and start the program in the terminal?

Sorry I failed to mention before that its in Ubuntu Linux

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

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

发布评论

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

评论(2

独自←快乐 2024-09-06 01:20:14

本文档介绍了如何将程序添加到程序菜单:http://standards.freedesktop。 org/menu-spec/latest/.

This document explains how to add your program to the programs menu: http://standards.freedesktop.org/menu-spec/latest/.

无声静候 2024-09-06 01:20:14

如果这是您正在制作的 Windows 可执行文件,您需要做的是使用资源编译器来制作一个目标文件,其中包含您想要的资源(在本例中为图标),然后您可以正常链接到您的程序。我在 Windows 上使用 gcc 构建程序时使用的资源编译器称为 windres

我发现在处理名称中带有空格的目录时非常挑剔。提防!

If this is a Windows executable you're making, what you need to do is to use a resource compiler to make an object file that includes the resources you want (an icon in this case) which you can then link into your program as normal. The resource compiler I've used when building programs on Windows with gcc was called windres.

I found it to be very finicky when dealing with directories with spaces in the name. Beware!

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