On Windows, when installing `windres' in a path which contains spaces, it will fail to execute even if you have the binutils in your PATH. To reproduce simply launch windres as: C:\apps\Eiffel60 x86/gcc/windows/mingw/bin/windres" -I../../.. ../../../sample.rc -O coff -o sample 'C:\apps\Eiffel60' is not recognized as an internal or external command, operable program or batch file. With the -v option I get: [C:\work\projects\61dev\EIFGENs\sample_normal\W_code]"C:\apps\Eiffel60 x86/gcc/windows/mingw/bin/windres.exe" -I../../.. ../../../sample.rc -O coff -o sample.res -v Using `C:\apps\Eiffel60 x86/gcc/windows/mingw/bin/gcc -E -xc -DRC_INVOKED -I../../.. ../../../sample.rc' Using popen to read preprocessor output 'C:\apps\Eiffel60' is not recognized as an internal or external command, operable program or batch file. It basically takes the path of `gcc' relative using the command line argument. So the solution is to simply surround the path to gcc with double quotes. For the moment I've used the `--preprocessor' option using: "C:\apps\Eiffel60 x86/gcc/windows/mingw/bin/windres" --preprocessor='"C:\apps\Eiffel60 x86/gcc/windows/mingw/bin/cpp.exe"' -I../../.. ../../../sample.rc -O coff -o sample.res but I'm not sure if it is equivalent to the default behavior of windres.
Please try with CVS binutils. Some of the popen 'spaces in file names' problems have been avoided. Danny
Do you have some information on how I can get the CVS binutils and compile it on Windows? Thanks, Manu
Subject: Re: windres does not escape path with spaces in them Hi Manu, > Do you have some information on how I can get the CVS binutils See: http://www.gnu.org/software/binutils/binutils.html > and compile it on Windows? See the README file at the top level in the sources you checked out of the CVS repository. Assuming that you are using a Cygwin or Mingw development environment then you should not have any difficulty compiling the binutils. Cheers Nick
Hmm, is this issue resolved?
As this issue is pretty old and I expect reporter won't reply anymore, I will close this bug. If issue still exists, please open an new report for it.
I'm still following this bug. So far I've been using the workaround successfully. I'll try on more time without the `--preprocessor' option and report back.
I got this bug today on MinGW-w64 5.1.0
Hi Guys, If I understand this bug report correctly, the problem is that the popen() system call does not cope with paths that contain spaces, right ? If so, then I am not sure that there is anything that the binutils can actually do. Is there a Windows specific way (or maybe mingw specific way) of converting a path containing spaces into one that does not contain spaces, but which will still locate the correct file ? Cheers Nick
Hmm, reads title of the PR.... OK so we need to escape the spaces in the name. Hang on sec then...
Created attachment 9119 [details] Proposed patch Could someone please try out this *experimental* patch and let me know if it works ? Cheers Nick
Looking at the patch it seems it would do what it supposed to do. Is there a way to get a binary version ?
Hi Emmanuel, > Looking at the patch it seems it would do what it supposed to do. Is there a > way to get a binary version ? Sorry - I do not have access to a mingw development environment. Where do you get your binaries from - maybe they could help create a new one for you ? I could possibly build a 64-bit cygwin targeted version of windres. Would that help ? Cheers Nick