Hi,
I test new implementation of LLVM 20.1.8 recently provided by CYGWIN64
on WIN11 64 bit.
Just to illustrated this strange behaviour read joined text : some tests
with different Resource Compiler.
I'm not a specialist, but it's seem important to ameliorate this
behaviour in future release of LLVM on Cygwin64.
You agree ?
Thank's.
Regards.
Thierry.
Tests with many Resource Compilers provided by CLANG 20.1.8 and
CYGWIN64 (native GCC + MinGW32/64)
These test is realized with example "Lesson25" of OpenGL NeHe tutorials, on
Windows 11 64 bits
All source files are moved into .\src subdirectory (here
C:\src\OpenGL\NeHe_lesson25-master) but the name of
the major directory is not important, you can test with your proper
arborescence.
List of these source files :
- Lesson25.c (main source of tutorial program, use GUI mode Win32)
- Lesson25.rc (main source of resource, contained identifcation of
icon of program, and version informations)
- resource.h (include file shared by two main sources)
Just add "C:\cygwin64\bin" in your PATH before this test, if not present.
A) First test with "x86_64-w64-mingw32-windres.exe" Resource Compiler
a) Test with "Windows normal" separator directories in the name of "input" file
(here file type "rc") :
x86_64-w64-mingw32-windres.exe
-IC:\cygwin64\usr\x86_64-w64-mingw32\sys-root\mingw\include -DNDEBUG -J rc -O
coff \
-i C:\src\OpenGL\NeHe_Lesson25-master\src\Lesson25.rc -o
objCLANGCYGW64\release\src\Lesson25.res
cc1: fatal error: C:srcOpenGLNeHe_Lesson25-mastersrcLesson25.rc: No such file
or directory
compilation terminated.
x86_64-w64-mingw32-windres: preprocessing failed.
b) Test with "Unix" separator directories in the name of "input" file (here
file type "rc") :
x86_64-w64-mingw32-windres.exe
-IC:\cygwin64\usr\x86_64-w64-mingw32\sys-root\mingw\include -DNDEBUG -J rc -O
coff \
-i C:/src/OpenGL/NeHe_Lesson25-master/src/Lesson25.rc -o
objCLANGCYGW64\release\src\Lesson25.res
Test OK
B) Second test with "windres.exe" Resource Compiler
a) Test with "Windows normal" separator directories in the name of "input" file
(here file type "rc") :
windres.exe -IC:\cygwin64\usr\x86_64-w64-mingw32\sys-root\mingw\include
-DNDEBUG -J rc -O coff \
-i C:\src\OpenGL\NeHe_Lesson25-master\src\Lesson25.rc -o
objCLANGCYGW64\release\src\Lesson25.res
cc1: fatal error: C:srcOpenGLNeHe_Lesson25-mastersrcLesson25.rc: No such file
or directory
compilation terminated.
windres: preprocessing failed.
b) Test with "Unix" separator directories in the name of "input" file (here
file type "rc") :
windres.exe -IC:\cygwin64\usr\x86_64-w64-mingw32\sys-root\mingw\include
-DNDEBUG -J rc -O coff \
-i C:/src/OpenGL/NeHe_Lesson25-master/src/Lesson25.rc -o
objCLANGCYGW64\release\src\Lesson25.res
Test OK
C) Third test with "llvm-windres.exe" Resource Compiler
a) Test with "Windows normal" separator directories in the name of "input" file
(here file type "rc") :
llvm-windres.exe -IC:\cygwin64\usr\x86_64-w64-mingw32\sys-root\mingw\include
-DNDEBUG --input-format=rc -output-format=coff \
--input=src\Lesson25.rc --output=objCLANGCYGW64\release\src\Lesson25.res
src\Lesson25.rc:26:10: fatal error: 'resource.h' file not found
26 | #include "resource.h"
| ^~~~~~~~~~~~
1 error generated.
llvm-rc: Preprocessing failed.
But, if you add ".\src" in the possibility of search of "Include File", test OK
:
llvm-windres.exe -IC:\cygwin64\usr\x86_64-w64-mingw32\sys-root\mingw\include
-DNDEBUG -I.\src --input-format=rc \
-output-format=coff --input=src\Lesson25.rc
--output=objCLANGCYGW64\release\src\Lesson25.res
Test OK with addon search list of directories for include files.
b) Test with "Unix" separator directories in the name of "input" file (here
file type "rc") :
llvm-windres.exe -IC:\cygwin64\usr\x86_64-w64-mingw32\sys-root\mingw\include
-DNDEBUG --input-format=rc -output-format=coff \
--input=src/Lesson25.rc --output=objCLANGCYGW64\release\src\Lesson25.res
Test OK
D) Conclusion
In my sense, it's not difficult to remake an tool like "windres" that can
accept in input either "native Windows" separator
either "Unix like" separator beetween levels of directories.
"llvm-windres.exe" can do that, but with "strange" behaviour about
identification of "include" file present in source file
with preprocessing instruction "#include", in the case of "Windows normal"
separator directories.
PS : Syntax accepted by these tools :
a) windres or x86_64-w64-mingw32-windres.exe
"windres.exe --help" or "x86_64-w64-mingw32-windres.exe --help"
Usage: x86_64-w64-mingw32-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.
x86_64-w64-mingw32-windres: supported targets: pe-x86-64 pei-x86-64
pe-bigobj-x86-64 elf64-x86-64 pe-i386 pei-i386 elf32-i386 elf32-iamcu pdb
elf64-little elf64-big elf32-little elf32-big srec symbolsrec verilog tekhex
binary ihex plugin
Report bugs to <https://sourceware.org/bugzilla/>
Example :
"windres.exe --version"
GNU windres (GNU Binutils) 2.45
Copyright (C) 2025 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.
b) llvm-windres
"llvm-windres.exe --help"
OVERVIEW: LLVM windres (GNU windres compatible)
USAGE: windres [options] file...
OPTIONS:
--codepage=<value> Default codepage to use
--define=<value> Define to pass to the preprocessor
--help Display this message and exit
--include-dir=<value> Include directory
--input-format=<value> Input format
--input=<value> Input file
--language=<value> Default language to use (0x0-0xffff)
--output-format=<value> Output format
--output=<value> Output file
--preprocessor-arg=<value>
Preprocessor command argument
--preprocessor=<value> Custom preprocessor command
--target=<value> Target BFD format name
--undefine=<value> Undefine to pass to the preprocessor
--use-temp-file Mimic GNU windres preprocessor option handling (don't
unescape preprocessor options)
--verbose Enable verbose output
--version Display version
Example :
"llvm-windres.exe --version"
llvm-windres, compatible with GNU windres
LLVM (http://llvm.org/):
LLVM version 20.1.8
Optimized build.
--
Problem reports: https://cygwin.com/problems.html
FAQ: https://cygwin.com/faq/
Documentation: https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple