1

i need to make the res runtime and it need to contain some icons i have in a list in my application. the res file has to be placed in a project "Resource File" field. so it needs to be win32 compatable.

i so fa tried to:

  • create a .resx file runtime containing the icons and i converted it to a .resources file with ResGen.exe but i ended up in a dead end.
  • i tried to fit the .resx i created in the project "Resource File" but it gives an error saying "the selected file is not a valid Win32 resource file".
  • i also tried to create a .rc file but i can't figure ut how to properly use rc.exe to compile it in a .res file so an other dead end as well...

do you have any idea of how i can achieve this?

if i try to compile a .rc file i get this output:

Microsoft (R) Windows (R) Resource Compiler, Version 5.1.2264.1 - Build 2264

Copyright (C) Microsoft Corp. 1985-1998. All rights reserved.

Using codepage 1252 as default

Creating rc - ResourceFile.res

RC: RCPP -CP 1252 -f C:\Users\itis\Desktop\RCa18040 -g C:\Users\itis\Desktop\RDa18040 -DRC_INVOKED -D_WIN32 -pc\:/ -E -I C:\Users\itis\Desktop\ -I .

C:\Users\itis\Desktop\_mingw.h(51) : error RC2188: #error : ERROR: You must use a GNU Compiler.

C:\Users\itis\Desktop\_mingw.h(55) : error RC2188: #error : ERROR: You must use a GNU Compiler version >= 3.4.5.

C:\Users\itis\Desktop\afxres.h(34) : fatal error RC1015: cannot open include file 'windows.h'.

Premere un tasto per continuare . . .

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
Fraŋkini
  • 118
  • 13

1 Answers1

3

Using rc.exe to compile a .rc file is the normal way to create a .res file.

A .rc file might be as simple as this:

1 ICON "myicon1.ico"
2 ICON "myicon2.ico"
Anders
  • 97,548
  • 12
  • 110
  • 164
  • 1
    Just saying it does not work is not helpful. I know it works if you do it correctly. What errors are you getting? – Anders Mar 17 '17 at 13:43
  • sorry it's just that i'm trying to post the code i have in one of the .rc files but it looks awful – Fraŋkini Mar 17 '17 at 13:54
  • 1
    You seem to be mixing MinGW and Microsoft toolchains, don't do that. A .rc file does not need any #include lines if you only need a couple of icons. – Anders Mar 17 '17 at 14:02
  • thank you so much! i don't know why it didn't worked before: i did try something like it but by not working i simply thought it would have been a way more complicated thing... but now it works perfectly! – Fraŋkini Mar 17 '17 at 14:20