I have tried it. But no, it does do the trick: one can not escape spaces with backslashes for include paths...<br><br>Here is my test command to see if windres accepts to escape spaces with backslashes.<br><br>$ cd "/C/Program Files/VTK 5.10.0/bin/Wrapping/Python" && /C/MinGW/bin/windres.exe -O coff -I"/C/Program\ Files/VTK\ 5.10.0/bin" -DVTK_IN_VTK "/C/Program Files/VTK 5.10.0/Wrapping/Python/vtkpython.rc" CMakeFiles/vtkpython.dir/vtkpython.rc.obj<br>
gcc: erreur: Files/VTK/\: No such file or directory<br>gcc: erreur: 5.10.0/bin: No such file or directory<br>c:\MinGW\bin\windres.exe: preprocessing failed.<br><br><br>Now, that everything compiled fine, I just realized that I have another problem:<br>
Most test programs that have been compiled are linked to MatLab libraries and requires access to MatLab libraries.<br>Most of them reports a missing entry point in MatLab libraries.<br>I suppose that MatLab was not compiled with gcc but MSVC. Another source of problems<br>
I just turn off the VTK MatLab and start the compilation process again...<br>I think I will have to do the magic trick again for my include paths...<br><br>Guillaume<br><br><br><div class="gmail_quote">2012/6/6 David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Guillaume,<br>
<br>
Will windres accept the spaces if you escape them with backslashes?<br>
E.g.:<br>
<br>
-I"/C/Program\ Files/VTK\ 5.10.0/bin"<br>
<span class="HOEnZb"><font color="#888888"><br>
- David<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
On Wed, Jun 6, 2012 at 10:58 AM, Guillaume Jacquenot<br>
<<a href="mailto:guillaume.jacquenot@gmail.com">guillaume.jacquenot@gmail.com</a>> wrote:<br>
> Dear all,<br>
><br>
> I would to build the VTK Python libraries on Win XP 32 bits with MinGW.<br>
> I have configured cmake to provide the python wrapping libraries<br>
><br>
> A problem arises with target vtkpython:<br>
> A gcc preprocessing called by program windres reports errors.<br>
> Apparently the gcc program does not support spaces for my include paths,<br>
> that are contained in my VTK source path<br>
> Other people have reported this bug on internet, but no good workarounds was<br>
> provided.<br>
><br>
> I have found a manual workaround to do the trick (explained below)<br>
><br>
><br>
> My configuration<br>
> - VTK 5.10.0<br>
> - Win XP 32<br>
> - MinGW G++ 4.6.2<br>
> - Python 2.7.2<br>
> - Path to VTK source directory: C:\Program Files\VTK 5.10.0 : Source of my<br>
> problem!<br>
><br>
> I have identified the problem with the command<br>
> make -n vtkpython<br>
><br>
> Here is the command that fails because of spaces in the include paths<br>
> (I voluntary suppress all the -I"vtk_diretories", I just kept once to<br>
> produce only one error)<br>
><br>
> cd "/C/Program Files/VTK 5.10.0/bin/Wrapping/Python" &&<br>
> /C/MinGW/bin/windres.exe -O coff -I"/C/Program Files/VTK 5.10.0/bin"<br>
> -DVTK_IN_VTK "/C/Program Files/VTK 5.10.0/Wrapping/Python/vtkpython.rc" CMak<br>
> eFiles/vtkpython.dir/vtkpython.rc.obj<br>
> gcc: erreur: Files/VTK\: No such file or directory<br>
> gcc: erreur: 5.10.0/bin: No such file or directory<br>
> c:\MinGW\bin\windres.exe: preprocessing failed.<br>
><br>
> Here is the version of windres I use<br>
><br>
> jacquenot@PC-GJ /C/Program Files/VTK 5.10.0/bin/Wrapping/Python<br>
> $ windres --version<br>
> GNU windres (GNU Binutils) 2.21.53.20110804<br>
> Copyright 2011 Free Software Foundation, Inc.<br>
><br>
><br>
> Solutions:<br>
><br>
> 1)<br>
> A solution that can work is to replace "Program Files" with "Program~1" and<br>
> "VTK 5.10.0" with "VTK~2"<br>
> The ~2 is because I have also a directory named VTK 5.8.0<br>
> This requires to replace the directory names with Windows naming conventions<br>
> and to have access to the directories to content to find the correct index<br>
> (~1 or ~2,...)<br>
><br>
> The following command works (does not produce error)<br>
> cd "/C/Program Files/VTK 5.10.0/bin/Wrapping/Python" &&<br>
> /C/MinGW/bin/windres.exe -O coff -I"/c/Program~1/VTK~2/bin" -DVTK_IN_VTK<br>
> "/C/Program Files/VTK 5.10.0/Wrapping/Pyt<br>
> hon/vtkpython.rc" CMakeFiles/vtkpython.dir/vtkpython.rc.obj<br>
><br>
><br>
> 2)<br>
> One solution would be to relocate VTK to a path without spaces.<br>
><br>
> 3)<br>
> Is there another workaround? This first solution is annoying...<br>
><br>
><br>
> What I finally did:<br>
> I generated the command that failed with<br>
> make -n vtkpython<br>
> I extracted the line command with windres program in my favorite text editor<br>
> I manually replaced "Program Files" with "Program~1" and "VTK 5.10.0" with<br>
> "VTK~2"<br>
> I executed that command successfully<br>
> I ran make again. vtkpython is successfully generated<br>
><br>
> Can someone explain to me what is the resource compiler windres used for?<br>
><br>
> Guillaume<br>
><br>
><br>
> Below is my ugly command<br>
><br>
> $ cd "/C/Program Files/VTK 5.10.0/bin/Wrapping/Python" &&<br>
> /C/MinGW/bin/windres.exe -O coff -I"/C/Program~1/VTK~2/bin"<br>
> -I"/C/Program~1/VTK~2/bin/Common" -I"/C/Program~1/VTK~2/bin/Utilit<br>
> ies" -I"/C/Program~1/VTK~2/bin/VolumeRendering"<br>
> -I"/C/Program~1/VTK~2/bin/Rendering" -I"/C/Program~1/VTK~2/bin/Charts"<br>
> -I"/C/Program~1/VTK~2/bin/Chemistry" -I"/C/Program~1/VTK~2/bin/Uti<br>
> lities/vtkalglib" -I"/C/Program~1/VTK~2/Wrapping/Python"<br>
> -I"/C/Program~1/VTK~2/bin/Wrapping/Python" -I"/C/Program~1/VTK~2/Infovis"<br>
> -I"/C/Program~1/VTK~2/Geovis" -I"/C/Program~1/VTK~2/Vi<br>
> ews" -I"/C/Program~1/VTK~2/VolumeRendering" -I"/C/Program~1/VTK~2/Hybrid"<br>
> -I"/C/Program~1/VTK~2/Widgets" -I"/C/Program~1/VTK~2/Rendering"<br>
> -I"/C/Program~1/VTK~2/Charts" -I"/C/Program~1/V<br>
> TK~2/Chemistry" -I"/C/Program~1/VTK~2/Rendering/Testing/Cxx"<br>
> -I"/C/Program~1/VTK~2/IO" -I"/C/Program~1/VTK~2/Imaging"<br>
> -I"/C/Program~1/VTK~2/Graphics" -I"/C/Program~1/VTK~2/GenericFilter<br>
> ing" -I"/C/Program~1/VTK~2/Filtering" -I"/C/Program~1/VTK~2/Common"<br>
> -I"/C/Program~1/VTK~2/Utilities" -I"/C/Program~1/VTK~2/Common/Testing/Cxx"<br>
> -I"/C/Program~1/VTK~2/bin/Utilities/vtknet<br>
> cdf/include" -I"/C/Program~1/VTK~2/Utilities/vtknetcdf/include"<br>
> -I"/C/Program~1/VTK~2/bin/Utilities/vtklibproj4"<br>
> -I"/C/Program~1/VTK~2/Utilities/vtklibproj4" -I"/C/Program~1/VTK~2/bin/U<br>
> tilities/DICOMParser" -I"/C/Program~1/VTK~2/Utilities/DICOMParser"<br>
> -I"/C/Program~1/VTK~2/bin/Utilities/vtkfreetype/include"<br>
> -I"/C/Program~1/VTK~2/Utilities/vtkfreetype/include" -I"/C/Pr<br>
> ogram~1/VTK~2/bin/Utilities/LSDyna" -I"/C/Program~1/VTK~2/Utilities/LSDyna"<br>
> -I"/C/Program~1/VTK~2/bin/Utilities/MaterialLibrary"<br>
> -I"/C/Program~1/VTK~2/Utilities/MaterialLibrary" -I"/C/P<br>
> rogram~1/VTK~2/bin/Utilities/vtkmetaio"<br>
> -I"/C/Program~1/VTK~2/Utilities/vtkmetaio"<br>
> -I"/C/Program~1/VTK~2/bin/Utilities/verdict"<br>
> -I"/C/Program~1/VTK~2/Utilities/verdict" -I"/C/Program~1/<br>
> VTK~2/bin/Utilities/vtkhdf5" -I"/C/Program~1/VTK~2/Utilities/vtkhdf5"<br>
> -I"/C/Program~1/VTK~2/bin/Utilities/vtkhdf5/src"<br>
> -I"/C/Program~1/VTK~2/Utilities/vtkhdf5/src" -I"/C/Program~1/VTK~2<br>
> /bin/Utilities/vtkhdf5/hl/src"<br>
> -I"/C/Program~1/VTK~2/Utilities/vtkhdf5/hl/src"<br>
> -I"/C/Program~1/VTK~2/Utilities/utf8/source"<br>
> -I"/C/Program~1/VTK~2/Utilities/vtkalglib" -I"/C/Program~1/VT<br>
> K~2/Utilities/ftgl/src" -I"/C/Program~1/VTK~2/bin/Utilities/ftgl"<br>
> -I"/C/Program~1/R/R-2.15.0/include" -I"/C/Program~1/Python27/include"<br>
> -I"/C/Program~1/MATLAB/R2012a/extern/include"<br>
> -DVTK_IN_VTK "/C/Program Files/VTK 5.10.0/Wrapping/Python/vtkpython.rc"<br>
> CMakeFiles/vtkpython.dir/vtkpython.rc.obj<br>
</div></div></blockquote></div><br>