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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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
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
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.