[vtkusers] Problem with python wrapping

David Gobbi david.gobbi at gmail.com
Thu Mar 26 12:07:24 EDT 2015


On Thu, Mar 26, 2015 at 9:57 AM, David Gobbi <david.gobbi at gmail.com> wrote:

> On Thu, Mar 26, 2015 at 9:25 AM, Armin Wehrfritz <dkxls23 at gmail.com>
> wrote:
>
>>
>>> ImportError: ./vtkMyFilterPython.so: : real_initvtkMyFilterPython
>>
>>
> The undefined symbol error probably means that your python module doesn't
> include vtkMyFilterPythonInit.cxx, which is one of the files generated by
> vtk_wrap_python3().
>
> Your cmake should include the Init.cxx as a source file when it builds the
> module, e.g.:
>
> add_library(vtkMyFilterPython MODULE vtkMyFilterPythonInit.cxx)
>
> Or, if that still doesn't fix the problem, then there might be an error in
> your add_library call for vtkMyFilterPythonD.
>

Oh, and the following lines are also necessary, but only if you build a
static library:

set_target_properties(vtkMyFilter PROPERTIES POSITION_INDEPENDENT_CODE ON)
set_target_properties(vtkMyFilterPythonD PROPERTIES
POSITION_INDEPENDENT_CODE ON)

 - David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150326/e6bb48cc/attachment.html>


More information about the vtkusers mailing list