[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 13:26:02 EDT 2012


I have tried it. But no, it does do the trick: one can not escape spaces
with backslashes for include paths...

Here is my test command to see if windres accepts to escape spaces with
backslashes.

$ 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
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.


Now, that everything compiled fine, I just realized that I have another
problem:
Most test programs that have been compiled are linked to MatLab libraries
and requires access to MatLab libraries.
Most of them reports a missing entry point in MatLab libraries.
I suppose that MatLab was not compiled with gcc but MSVC. Another source of
problems
I just turn off the VTK MatLab and start the compilation process again...
I think I will have to do the magic trick again for my include paths...

Guillaume


2012/6/6 David Gobbi <david.gobbi at gmail.com>

> Hi Guillaume,
>
> Will windres accept the spaces if you escape them with backslashes?
> E.g.:
>
> -I"/C/Program\ Files/VTK\ 5.10.0/bin"
>
>  - David
>
>
> On Wed, Jun 6, 2012 at 10:58 AM, Guillaume Jacquenot
> <guillaume.jacquenot at gmail.com> wrote:
> > 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/f493bfd4/attachment.htm>


More information about the vtkusers mailing list