Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
windres fix
thomas:
I looked into the well-known space-in-path problem encountered with windres today. As it happens, the workaround is quite easy.
First, it does not seem to make sense why it should not work, using the same runtime as all the gnu tools (which all work fine). Looking at the documentation reveals: "When windres reads an rc file, it runs it through the C preprocessor first."
Aha! It seems that windres correctly removes any quotes and then calls gcc with the unquoted filename to preprocess the .rc file.
So what does the workaround look like? Easy:
windres.exe -i "\"D:\foo bar baz\many spaces\project.rc\"" -J rc -o obj\project.res -O coff
runs without any problems.
Sure enough, this doesn't work with any other tool, the compiler will complain about the double quotes if you feed them to it. So, what needs to be done is simply a small piece of extra code in the compiler plugin, checking for windres, and either adding the extra quotes manually or giving an extra flag to QuoteStringIfNeeded.
mandrav:
--- Quote from: thomas on July 30, 2007, 05:03:39 pm ---So, what needs to be done is simply a small piece of extra code in the compiler plugin, checking for windres
--- End quote ---
Hmm, as far as I recall there is no such problem for quite some time. We had solved it by using the short path version of the filename (e.g. C:\SOMEPA~1\file.rc)...
thomas:
Revision 4182:
-------------- Build: default in foo ---------------
windres.exe -i "D:\foo bar baz\many spaces\project.rc" -J rc -o obj\project.res -O coff -IC:\MinGW\include
gcc: D:\foo: No such file or directory
gcc: bar: No such file or directory
gcc: baz\many: No such file or directory
gcc: spaces\project.rc: No such file or directory
gcc: warning: `-x c' after last input file has no effect
gcc: no input files
windres.exe: no resources
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 1 warnings
MortenMacFly:
--- Quote from: mandrav on July 30, 2007, 07:10:16 pm ---Hmm, as far as I recall there is no such problem for quite some time. We had solved it by using the short path version of the filename (e.g. C:\SOMEPA~1\file.rc)...
--- End quote ---
Notice there are systems that have short path functionality disabled (can be done in NTFS). So this isn't a very good solution anyway. (I know from other projects...)
With regards, Morten.
mandrav:
Well, you both may very well be right. I haven't used windows for quite some time anyway :).
Navigation
[0] Message Index
[#] Next page
Go to full version