Adding icon to the .exe file

hi all, this is my firist question
am new to programming and wanna know how can I add icon to the executable file I made. I can do the stuff using the Dev-C++ IDE, but now am using CodeBlocks ( I think its better - or suggest me one). If there is another software to change icons of executable files tell me. Thanks!!
Download the `.ico` icon you want from here:
http://www.iconarchive.com/

Right click the file -> properties

Select `shortcut` tab -> Change icon -> Browse -> select the icon you downloaded
ya, thanks for your help. But i don't need additonal shortcut to my file, I just want to change the icon of the executable file. NOT A SHORTCUT
Which compiler do you use? If you're codeblocks on Windows, I'm guessing it's MinGW.

Check this out:
http://stackoverflow.com/questions/708238/how-do-i-add-an-icon-to-a-mingw-gcc-compiled-executable

Summary:
1. First make a resource (.rc) file which refers to the icon like so:
id ICON "path/to/my.ico"
2. Compile it into an object:
windres my.rc -O coff -o my.res
3. Link it into your exe with the rest of your project:
g++ -o my_app obj1.o obj2.o my.res

Since this uses command-line build-commands instead of using the codeblocks interface, try this:
1. Add your .rc file to your project, then right-click on the file and select "Properties".
2. Go to "advanced"
3. Select "use customer command to build this file"
4. Add windres my.rc -O coff -o $object
Last edited on
I have stated above that am new to programming teaching myself, am now on the chapters of function. Your code above is hard for me to understand. ( I think it needs the knowledge of classes and objects ) any ways thanks a lot for your help am sure your code works fine. It is my stupidity that makes your answer not useful. And Duoas I will try the resource hacker tool
 
Thank you very much
Last edited on
If you're just learning functions, then you don't want to move to resources just yet. Be patient! You're probably not stupid. We were all learning functions at some point.
Object files/code doesn't have to do with the concept of classes in C++ or OOP. The IDE you're using probably does all the linking for you.
Topic archived. No new replies allowed.