Menu

windres: preprocessing failed

Help
Fred
2014-01-14
2014-08-24
  • Fred

    Fred - 2014-01-14

    Hi,
    To fix this error, I had to make a copy of the prefixed gcc in the bin directory and rename it to gcc.exe.
    For 32 and 64 bit builds of mingw-builds-install.exe (169962 byte, no versioninfo).

    Regards,
    Fred

     
  • Kai Tietz

    Kai Tietz - 2014-01-14

    Proper fix of this isn't to override OS gcc. By default windres tries to invoke cross-gcc, if not found it will invoke OS gcc. So see here windres' options --preprocessor=, --preprocessor-arg=, and --target=<target> option.
    By these options your problem should be solvable without such hacks.

    Regards, Kai

     
  • Fred

    Fred - 2014-01-15

    Hi Kai,
    thank you for your hints.
    I also dont like hacks like this, and changed the windres command to
    windres --preprocessor=x86_64-w64-mingw32-g++.exe --preprocessor-arg=-E --preprocessor-arg=-xc-header --preprocessor-arg=-DRC_INVOKED -i main.rc -o main.rc.o

    It is inconvenient to add every single arg, but it works.
    Thank you,
    Fred

     
  • David Costanzo

    David Costanzo - 2014-08-24

    Thank you both. I had the same problem and was at a complete loss to understand the root of the problem. Basically, I had a project that I had compiled a year ago, and it wouldn't compile today and I didn't know what I had changed in the meantime. Fred's command line additions fixed my problem.

    I am using MinGW to "cross compile" under Cygwin and windres was (as Fred hinted and Kai explained) using the Cygwin gcc for pre-processing. I don't know why Cygwin's gcc can't preprocess a simple RC file, but explicitly specifying MinGW's gcc works.

     

Log in to post a comment.