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, that are contained in my VTK source path<br>Other people have reported this bug on internet, but no good workarounds was 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 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&quot;vtk_diretories&quot;, I just kept once to produce only one error)<br><br><span style="font-family:courier new,monospace">cd &quot;/C/Program Files/VTK 5.10.0/bin/Wrapping/Python&quot; &amp;&amp; /C/MinGW/bin/windres.exe  -O coff -I&quot;/C/Program Files/VTK 5.10.0/bin&quot;  -DVTK_IN_VTK &quot;/C/Program Files/VTK 5.10.0/Wrapping/Python/vtkpython.rc&quot; CMak</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">eFiles/vtkpython.dir/vtkpython.rc.obj</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">gcc: erreur: Files/VTK\: No such file or directory</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">gcc: erreur: 5.10.0/bin: No such file or directory</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">c:\MinGW\bin\windres.exe: preprocessing failed.</span><br>
<br>Here is the version of windres I use<br><br><span style="font-family:courier new,monospace">jacquenot@PC-GJ /C/Program Files/VTK 5.10.0/bin/Wrapping/Python</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">$ windres --version</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">GNU windres (GNU Binutils) 2.21.53.20110804</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">Copyright 2011 Free Software Foundation, Inc.</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"></span><br>
<br>Solutions:<br><br>1)<br>A solution that can work is to replace &quot;Program Files&quot; with &quot;Program~1&quot; and &quot;VTK 5.10.0&quot; with &quot;VTK~2&quot;<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 and to have access to the directories to content to find the correct index (~1 or ~2,...)<br><br>The following command works (does not produce error)<br>
cd &quot;/C/Program Files/VTK 5.10.0/bin/Wrapping/Python&quot; &amp;&amp; /C/MinGW/bin/windres.exe  -O coff -I&quot;/c/Program~1/VTK~2/bin&quot; -DVTK_IN_VTK &quot;/C/Program Files/VTK 5.10.0/Wrapping/Pyt<br>hon/vtkpython.rc&quot; 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  &quot;Program Files&quot; with &quot;Program~1&quot; and &quot;VTK 5.10.0&quot; with &quot;VTK~2&quot;<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>
<span style="font-family:courier new,monospace"></span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">$ cd &quot;/C/Program Files/VTK 5.10.0/bin/Wrapping/Python&quot; &amp;&amp; /C/MinGW/bin/windres.exe  -O coff -I&quot;/C/Program~1/VTK~2/bin&quot; -I&quot;/C/Program~1/VTK~2/bin/Common&quot; -I&quot;/C/Program~1/VTK~2/bin/Utilit</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">ies&quot; -I&quot;/C/Program~1/VTK~2/bin/VolumeRendering&quot; -I&quot;/C/Program~1/VTK~2/bin/Rendering&quot; -I&quot;/C/Program~1/VTK~2/bin/Charts&quot; -I&quot;/C/Program~1/VTK~2/bin/Chemistry&quot; -I&quot;/C/Program~1/VTK~2/bin/Uti</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">lities/vtkalglib&quot; -I&quot;/C/Program~1/VTK~2/Wrapping/Python&quot; -I&quot;/C/Program~1/VTK~2/bin/Wrapping/Python&quot; -I&quot;/C/Program~1/VTK~2/Infovis&quot; -I&quot;/C/Program~1/VTK~2/Geovis&quot; -I&quot;/C/Program~1/VTK~2/Vi</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">ews&quot; -I&quot;/C/Program~1/VTK~2/VolumeRendering&quot; -I&quot;/C/Program~1/VTK~2/Hybrid&quot; -I&quot;/C/Program~1/VTK~2/Widgets&quot; -I&quot;/C/Program~1/VTK~2/Rendering&quot; -I&quot;/C/Program~1/VTK~2/Charts&quot; -I&quot;/C/Program~1/V</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">TK~2/Chemistry&quot; -I&quot;/C/Program~1/VTK~2/Rendering/Testing/Cxx&quot; -I&quot;/C/Program~1/VTK~2/IO&quot; -I&quot;/C/Program~1/VTK~2/Imaging&quot; -I&quot;/C/Program~1/VTK~2/Graphics&quot; -I&quot;/C/Program~1/VTK~2/GenericFilter</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">ing&quot; -I&quot;/C/Program~1/VTK~2/Filtering&quot; -I&quot;/C/Program~1/VTK~2/Common&quot; -I&quot;/C/Program~1/VTK~2/Utilities&quot; -I&quot;/C/Program~1/VTK~2/Common/Testing/Cxx&quot; -I&quot;/C/Program~1/VTK~2/bin/Utilities/vtknet</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">cdf/include&quot; -I&quot;/C/Program~1/VTK~2/Utilities/vtknetcdf/include&quot; -I&quot;/C/Program~1/VTK~2/bin/Utilities/vtklibproj4&quot; -I&quot;/C/Program~1/VTK~2/Utilities/vtklibproj4&quot; -I&quot;/C/Program~1/VTK~2/bin/U</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">tilities/DICOMParser&quot; -I&quot;/C/Program~1/VTK~2/Utilities/DICOMParser&quot; -I&quot;/C/Program~1/VTK~2/bin/Utilities/vtkfreetype/include&quot; -I&quot;/C/Program~1/VTK~2/Utilities/vtkfreetype/include&quot; -I&quot;/C/Pr</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">ogram~1/VTK~2/bin/Utilities/LSDyna&quot; -I&quot;/C/Program~1/VTK~2/Utilities/LSDyna&quot; -I&quot;/C/Program~1/VTK~2/bin/Utilities/MaterialLibrary&quot; -I&quot;/C/Program~1/VTK~2/Utilities/MaterialLibrary&quot; -I&quot;/C/P</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">rogram~1/VTK~2/bin/Utilities/vtkmetaio&quot; -I&quot;/C/Program~1/VTK~2/Utilities/vtkmetaio&quot; -I&quot;/C/Program~1/VTK~2/bin/Utilities/verdict&quot; -I&quot;/C/Program~1/VTK~2/Utilities/verdict&quot; -I&quot;/C/Program~1/</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">VTK~2/bin/Utilities/vtkhdf5&quot; -I&quot;/C/Program~1/VTK~2/Utilities/vtkhdf5&quot; -I&quot;/C/Program~1/VTK~2/bin/Utilities/vtkhdf5/src&quot; -I&quot;/C/Program~1/VTK~2/Utilities/vtkhdf5/src&quot; -I&quot;/C/Program~1/VTK~2</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">/bin/Utilities/vtkhdf5/hl/src&quot; -I&quot;/C/Program~1/VTK~2/Utilities/vtkhdf5/hl/src&quot; -I&quot;/C/Program~1/VTK~2/Utilities/utf8/source&quot; -I&quot;/C/Program~1/VTK~2/Utilities/vtkalglib&quot; -I&quot;/C/Program~1/VT</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">K~2/Utilities/ftgl/src&quot; -I&quot;/C/Program~1/VTK~2/bin/Utilities/ftgl&quot; -I&quot;/C/Program~1/R/R-2.15.0/include&quot; -I&quot;/C/Program~1/Python27/include&quot; -I&quot;/C/Program~1/MATLAB/R2012a/extern/include&quot;    </span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">-DVTK_IN_VTK &quot;/C/Program Files/VTK 5.10.0/Wrapping/Python/vtkpython.rc&quot; CMakeFiles/vtkpython.dir/vtkpython.rc.obj</span><br style="font-family:courier new,monospace">
<br><br>