Msys2-packages: No x86_64-w64-mingw32-windres.exe

Created on 30 Jun 2017  路  8Comments  路  Source: msys2/MSYS2-packages

In /mingw64/bin there is no x86_64-w64-mingw32-windres.exe but there is a windres.exe. When I manually copy windres.exe to x86_64-w64-mingw32-windres.exe everything works for now.

Is there a special reason why this is not done automatically during installation (just like gcc.exe, g++.exe, etc, etc)?

Most helpful comment

Yes, cross compiling is exactly my use case!

All the gcc exe's on MSYS2 (22 in total in my /mingw64/bin/) are available with and without the architecture prefix, apart from windres.exe. That is weird and inconsistent.

I use MSYS2-64 to build both a 32-bit as well as a 64 bit version of my project like https://github.com/ffes/indentbyfold and https://github.com/ffes/nppsnippets. I use the prefix to be sure I always use the right architecture, no matter which platform I compile on, be it MSYS, Cygwin and even Linux (for CI integration).

So I want to explicitly say which architecture to use and that is not possible with MSYS2 because there is no x86_64-w64-mingw32-windres.exe.

All 8 comments

Prefixed executables usually creating for cross tools

Yes, cross compiling is exactly my use case!

All the gcc exe's on MSYS2 (22 in total in my /mingw64/bin/) are available with and without the architecture prefix, apart from windres.exe. That is weird and inconsistent.

I use MSYS2-64 to build both a 32-bit as well as a 64 bit version of my project like https://github.com/ffes/indentbyfold and https://github.com/ffes/nppsnippets. I use the prefix to be sure I always use the right architecture, no matter which platform I compile on, be it MSYS, Cygwin and even Linux (for CI integration).

So I want to explicitly say which architecture to use and that is not possible with MSYS2 because there is no x86_64-w64-mingw32-windres.exe.

Indeed the problem still persists. Since obviously there doesn't seem to be any interest whatsoever in fixing this issue my suggestion for a workaround is to manually create a copy of the respective files and name them i686-w64-mingw32-windres and x86_64-w64-mingw32-windres respectively.

Absolutely still an issue. The Linux systems don't have windres but do have it prefixed, while the Windows systems on MSYS2 don't have the prefixed one but do have windres...

The issue should be reopened. Note that the error does not only affect windres but also some other programs that should be prefixed. The error appears on i686-w64-mingw32 and x86_64-w64-mingw32. The following is my work-around for the bug, where the $MSYSTEM_PREFIX variable is set by MSYS2 and corresponds to the environment prefix, and $HOST is the user-defined compilation triplet. If symlinks have been enabled, the work-around is costless, otherwise it costs a copy.

if [ ! -e "${MSYSTEM_PREFIX}/bin/${HOST}-windres.exe" ]; then
    ln -s "${MSYSTEM_PREFIX}"/bin/windres.exe "${MSYSTEM_PREFIX}/bin/${HOST}-windres.exe"
fi
if [ ! -e "${MSYSTEM_PREFIX}/bin/${HOST}-as.exe" ]; then
    ln -s "${MSYSTEM_PREFIX}"/bin/as.exe "${MSYSTEM_PREFIX}/bin/${HOST}-as.exe"
fi

@MisterDA prefixed binaries are used only for crosscompiling. We builds native, so this is not the issue

What if I want to use MSYS2 to cross-compile?
For instance, on Windows, the OCaml compiler needs a Cygwin/MSYS2 environment to be build, even though the environment is not required at runtime.

Msys2 environment allow to build mingw applications natively. If you want cross-compile then use Msys-mingw crosscompilers

Was this page helpful?
0 / 5 - 0 ratings

Related issues

totaam picture totaam  路  4Comments

urbster1 picture urbster1  路  7Comments

borekb picture borekb  路  4Comments

mappu picture mappu  路  4Comments

linux2014linux picture linux2014linux  路  3Comments