Hello everyone,

I am working in the latest version of MinGW (downloaded 12/12/2011). I am attempting to compile a .rc file using Windres.exe. I use the command: windres -O coff about1.rc -o about1.res. Windres generates perhaps 100 or more warning messages saying "null characters ignored", and then it terminates with the message: "About1.rc:1:syntax error".

There are no null characters in the source file. To add to the puzzle, exactly the same About1.rc file compiles smoothly if I use MSFT rc.exe. The resulting .res file links with the program .obj file and runs smoothly.

I have tried using the switch --use-temp-file in the command line, and this does not solve the problem.

Anybody have a suggestion?

Thanks
Mark Allyn

Member Avatar for jmichae3

see windres --help.

Usage: windres [option(s)] [input-file] [output-file]
The options are:
-i --input=<file> Name input file
-o --output=<file> Name output file
-J --input-format=<format> Specify input format
-O --output-format=<format> Specify output format
-F --target=<target> Specify COFF target
--preprocessor=<program> Program to use to preprocess rc file
--preprocessor-arg=<arg> Additional preprocessor argument
-I --include-dir=<dir> Include directory when preprocessing rc file
-D --define <sym>[=<val>] Define SYM when preprocessing rc file
-U --undefine <sym> Undefine SYM when preprocessing rc file
-v --verbose Verbose - tells you what it's doing
-c --codepage=<codepage> Specify default codepage
-l --language=<val> Set language when reading rc file
--use-temp-file Use a temporary file instead of popen to read
the preprocessor output
--no-use-temp-file Use popen (default)
-r Ignored for compatibility with rc
@<file> Read options from <file>
-h --help Print this help message
-V --version Print version information
FORMAT is one of rc, res, or coff, and is deduced from the file name
extension if not specified. A single file name is an input file.
No input-file is stdin, default rc. No output-file is stdout, default rc.
windres: supported targets: pe-i386 pei-i386 elf32-i386 elf32-little elf32-big srec symbolsrec verilog tekhex binary ihex

windres --input=about1.rc --input-format=rc --output=about1.res --output-format=coff


you would link in the .res file by including that on the command line like a .cpp file, just like you would do to link in a .o or .a lib file

this works for Manifest XML Resource files as well to make things vista/7/8 compatible. there is a special usage of that format just to make it work with all platforms.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.