0

When running ([filename] is just a placeholder]) windres -v -i [filename].rc -o [filename].o in the terminal I get the following messages:

gcc -E -xc -DRC_INVOKED [filename].rc'

Using popen to read preprocessor output

windres.exe: [filename].rc:1: syntax error

I don't understand why there is a syntax error. I am trying to set an icon for an executable like this https://wiki.haskell.org/Setting_an_executable_icon , but don't get it working. What is the solution to this?

Ari Fordsham
  • 2,437
  • 7
  • 28
  • Similar post : https://stackoverflow.com/questions/58504153/how-to-build-a-project-with-an-icon-by-cabal-build-or-stack-build – Johannes Green Dec 01 '20 at 18:33
  • 1
    This looks like a syntax error in your RC file, not an issue with your Haskell code. Please edit your question to include the exact contents of that file. In the tutorial you link and in the [ICON Resource](https://learn.microsoft.com/en-us/windows/win32/menurc/icon-resource) documentation, it specifies that the RC syntax for defining an icon resource is `nameID ICON filename` where `nameID` is an integer (`1` in the example you linked) or identifier, and `filename` is a quoted string (`"favicon.ico"`). – Jon Purdy Dec 01 '20 at 23:59
  • Thank you Jon! I was thinking the 1 before the ICON filename was referring to the first line in the .rc file. Got it working now! – Johannes Green Dec 02 '20 at 10:50

0 Answers0