开发者

Adding icon to gcc executable and opening in terminal

I made a program to connect to a device via Bluetooth and send the data to the web using pure C in gcc. I w开发者_JAVA技巧on'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


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


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!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜