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"vtk_diretories", I just kept once to produce only one error)<br><br><span style="font-family:courier new,monospace">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" 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 "Program Files" with "Program~1" and "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 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 "/C/Program Files/VTK 5.10.0/bin/Wrapping/Python" && /C/MinGW/bin/windres.exe -O coff -I"/c/Program~1/VTK~2/bin" -DVTK_IN_VTK "/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 "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>
<span style="font-family:courier new,monospace"></span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">$ cd "/C/Program Files/VTK 5.10.0/bin/Wrapping/Python" && /C/MinGW/bin/windres.exe -O coff -I"/C/Program~1/VTK~2/bin" -I"/C/Program~1/VTK~2/bin/Common" -I"/C/Program~1/VTK~2/bin/Utilit</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">ies" -I"/C/Program~1/VTK~2/bin/VolumeRendering" -I"/C/Program~1/VTK~2/bin/Rendering" -I"/C/Program~1/VTK~2/bin/Charts" -I"/C/Program~1/VTK~2/bin/Chemistry" -I"/C/Program~1/VTK~2/bin/Uti</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">lities/vtkalglib" -I"/C/Program~1/VTK~2/Wrapping/Python" -I"/C/Program~1/VTK~2/bin/Wrapping/Python" -I"/C/Program~1/VTK~2/Infovis" -I"/C/Program~1/VTK~2/Geovis" -I"/C/Program~1/VTK~2/Vi</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">ews" -I"/C/Program~1/VTK~2/VolumeRendering" -I"/C/Program~1/VTK~2/Hybrid" -I"/C/Program~1/VTK~2/Widgets" -I"/C/Program~1/VTK~2/Rendering" -I"/C/Program~1/VTK~2/Charts" -I"/C/Program~1/V</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">TK~2/Chemistry" -I"/C/Program~1/VTK~2/Rendering/Testing/Cxx" -I"/C/Program~1/VTK~2/IO" -I"/C/Program~1/VTK~2/Imaging" -I"/C/Program~1/VTK~2/Graphics" -I"/C/Program~1/VTK~2/GenericFilter</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">ing" -I"/C/Program~1/VTK~2/Filtering" -I"/C/Program~1/VTK~2/Common" -I"/C/Program~1/VTK~2/Utilities" -I"/C/Program~1/VTK~2/Common/Testing/Cxx" -I"/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" -I"/C/Program~1/VTK~2/Utilities/vtknetcdf/include" -I"/C/Program~1/VTK~2/bin/Utilities/vtklibproj4" -I"/C/Program~1/VTK~2/Utilities/vtklibproj4" -I"/C/Program~1/VTK~2/bin/U</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">tilities/DICOMParser" -I"/C/Program~1/VTK~2/Utilities/DICOMParser" -I"/C/Program~1/VTK~2/bin/Utilities/vtkfreetype/include" -I"/C/Program~1/VTK~2/Utilities/vtkfreetype/include" -I"/C/Pr</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">ogram~1/VTK~2/bin/Utilities/LSDyna" -I"/C/Program~1/VTK~2/Utilities/LSDyna" -I"/C/Program~1/VTK~2/bin/Utilities/MaterialLibrary" -I"/C/Program~1/VTK~2/Utilities/MaterialLibrary" -I"/C/P</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">rogram~1/VTK~2/bin/Utilities/vtkmetaio" -I"/C/Program~1/VTK~2/Utilities/vtkmetaio" -I"/C/Program~1/VTK~2/bin/Utilities/verdict" -I"/C/Program~1/VTK~2/Utilities/verdict" -I"/C/Program~1/</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">VTK~2/bin/Utilities/vtkhdf5" -I"/C/Program~1/VTK~2/Utilities/vtkhdf5" -I"/C/Program~1/VTK~2/bin/Utilities/vtkhdf5/src" -I"/C/Program~1/VTK~2/Utilities/vtkhdf5/src" -I"/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" -I"/C/Program~1/VTK~2/Utilities/vtkhdf5/hl/src" -I"/C/Program~1/VTK~2/Utilities/utf8/source" -I"/C/Program~1/VTK~2/Utilities/vtkalglib" -I"/C/Program~1/VT</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">K~2/Utilities/ftgl/src" -I"/C/Program~1/VTK~2/bin/Utilities/ftgl" -I"/C/Program~1/R/R-2.15.0/include" -I"/C/Program~1/Python27/include" -I"/C/Program~1/MATLAB/R2012a/extern/include" </span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">-DVTK_IN_VTK "/C/Program Files/VTK 5.10.0/Wrapping/Python/vtkpython.rc" CMakeFiles/vtkpython.dir/vtkpython.rc.obj</span><br style="font-family:courier new,monospace">
<br><br>