CodeBlocks - How to add an icon to a C program?

I have a small C console program, and I want to add the .ico file to it so that the executable looks beautiful.

How to do this in CodeBlocks using MinGW / gcc?

+4
source share
1 answer

I could not find the appropriate help through Google, which could be followed by a total newbie (like me for C), so I will answer questions in this thread.

  • First of all, you need a .ico file. Put it in the folder with your main.c. file
  • In CodeBlocks go to File → New → Empty Fileand name it. icon.rcIt should be visible in the workspace / project, otherwise CodeBlocks will not know about this file. It will be displayed in the project folder with the name Resources.
  • : MAINICON ICON "filename.ico". MAINICON - , - . 1 & 2.
  • - CodeBlocks

, windres.exe ( ) icon.rc obj\Release\icon.res. .

, , - , -, - .

+5

Source: https://habr.com/ru/post/1694624/


All Articles