Game Development Community

icon for exe

by Sabrecyd · in Technical Issues · 12/09/2002 (8:49 am) · 14 replies

How can the exe file (torquedemo.exe for example) be compiled with an icon file? I'm using MSVC++6. This seems like it should be simple but I can't find a way to do it. Somewhere in the project settings? Anyway, it'd be nice to use a unique icon instead of just having that boring windows default.

Thanks,
-Sabrecyd

#1
12/09/2002 (9:03 am)
Select your Resource View tab, then right click on any resource folder in that view, and select the "Insert...". In the dialog that pops up select Icon.

Then edit your new Icon, which should have the name IDI_ICON1.

Rebuild, et voila !
#2
12/09/2002 (9:43 am)
Ken, Do I need to set that icon to be used somewhere too? I imported it in the resource tab and recompiled like you said but it's not using it.
#3
12/09/2002 (3:33 pm)
Sorry Sabre -

You should get a file called ICON1.ICO generated after the compile. In the FileView tab of the Workspace window in the VC++ IDE add this file to Torque Demo Files (or whatever your game project is called), and relink. It may take a refresh of your exe output directory to see the icon.
#4
12/09/2002 (6:15 pm)
"ReLink" could you describe for the VS challenged.
#5
12/09/2002 (7:25 pm)
hehe, I said "relink" so as to not be VS-specific (even though the rest of it was :-)

try Rebuild instead. No need for a Clean rebuild though.
#6
12/10/2002 (6:13 am)
Thanks for the further info Ken. I still must be missing something tho. I get the icon1.ico being generated. It either puts it in the tools/max3dtsExporter folder or the tools/ms2dtsExporter folder depending on which of the two folders the icon is added to in the resource view. I can then add it to the project fine (Torque Demo Files for example) but it doesn't apply the icon to the exe file after relinking or rebuilding. Any ideas? Sorry to be a pain :)
#7
12/10/2002 (8:14 am)
I actually had a .ico made already and just imported it the same way you were explaining to make a new one. I checked both the .rc and exporter.h to make sure that the filename was used, and all that is fine. I added the file to the projeect ( no place in particular) but like Saby I can't get it to generate with my Icon
#8
12/10/2002 (3:25 pm)
OK guys,

I knew I was going to have to do this in my project as well, so I've taken the time to research this and create a detail document on the steps necessary to do this. Let me know if it works for you. The process is quite easy, but you do need to do a few steps.

http://dxgames.tripod.com/Icons.doc

Good luck.
#9
12/10/2002 (4:23 pm)
That did it! Thanks Keith. Pretty easy once you know how :) I'm sure almost everyone will want to do this.
#10
12/10/2002 (5:58 pm)
Yes it is really quite simple, thx Keith.
#11
12/10/2002 (7:53 pm)
works perfectly Many thanks
#12
12/11/2002 (6:40 am)
Keith: Thanks, that's very nice work, maybe you should consider submitting it as a resource?
#13
12/11/2002 (9:32 am)
Good idea. It's now posted as a resource as well.
#14
12/23/2003 (12:45 pm)
Ok I tried recompiling afterwards, and this is what I get:

--------------------Configuration: Torque Demo - Win32 Release--------------------
Linking...
itfdump.obj : error LNK2001: unresolved external symbol _texGen0
itfdump.obj : error LNK2001: unresolved external symbol _texGen1
itfdump.obj : error LNK2001: unresolved external symbol _fogCoordinatePointer
blender_asm.obj : error LNK2001: unresolved external symbol _lumels
LINK : error LNK2001: unresolved external symbol _mainCRTStartup
../example/torqueDemo.exe : fatal error LNK1120: 5 unresolved externals
Error executing link.exe.

torqueDemo.exe - 6 error(s), 0 warning(s)