[vtkusers] Problem creating VTK Python libraries on Win XP 32 bits with MinGW: Spaces are not supported in include path for windres

Guillaume Jacquenot guillaume.jacquenot at gmail.com
Wed Jun 6 12:58:33 EDT 2012


Dear all,

I would to build the VTK Python libraries on Win XP 32 bits with MinGW.
I have configured cmake to provide the python wrapping libraries

A problem arises with target vtkpython:
A gcc preprocessing called by program windres reports errors.
Apparently the gcc program  does not support spaces for my include paths,
that are contained in my VTK source path
Other people have reported this bug on internet, but no good workarounds
was provided.

I have found a manual workaround to do the trick (explained below)


My configuration
- VTK 5.10.0
- Win XP 32
- MinGW G++ 4.6.2
- Python 2.7.2
- Path to VTK source directory: C:\Program Files\VTK 5.10.0 : Source of my
problem!

I have identified the problem with the command
make -n vtkpython

Here is the command that fails because of spaces in the include paths
(I voluntary suppress all the -I"vtk_diretories", I just kept once to
produce only one error)

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
eFiles/vtkpython.dir/vtkpython.rc.obj
gcc: erreur: Files/VTK\: No such file or directory
gcc: erreur: 5.10.0/bin: No such file or directory
c:\MinGW\bin\windres.exe: preprocessing failed.

Here is the version of windres I use

jacquenot at PC-GJ /C/Program Files/VTK 5.10.0/bin/Wrapping/Python
$ windres --version
GNU windres (GNU Binutils) 2.21.53.20110804
Copyright 2011 Free Software Foundation, Inc.


Solutions:

1)
A solution that can work is to replace "Program Files" with "Program~1" and
"VTK 5.10.0" with "VTK~2"
The ~2 is because I have also a directory named VTK 5.8.0
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,...)

The following command works (does not produce error)
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
hon/vtkpython.rc" CMakeFiles/vtkpython.dir/vtkpython.rc.obj


2)
One solution would be to relocate VTK to a path without spaces.

3)
Is there another workaround? This first solution is annoying...


What I finally did:
I generated the command that failed with
make -n vtkpython
I extracted the line command with windres program in my favorite text editor
I manually replaced "Program Files" with "Program~1" and "VTK 5.10.0" with
"VTK~2"
I executed that command successfully
I ran make again. vtkpython is successfully generated

Can someone explain to me what is the resource compiler windres used for?

Guillaume


Below is my ugly command

$ 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
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
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
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
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
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
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
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
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
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/
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
/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
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"
-DVTK_IN_VTK "/C/Program Files/VTK 5.10.0/Wrapping/Python/vtkpython.rc"
CMakeFiles/vtkpython.dir/vtkpython.rc.obj
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120606/5ad3d193/attachment.htm>


More information about the vtkusers mailing list