[vtkusers] Problem with python wrapping

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


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

>
>
> 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)
>

I forgot the the line that is probably the most likely to fix the
real_initvtkMyFilterPython symbol error:

  target_link_libraries(vtkMyFilterPython vtkMyFilterPythonD)

In summary, a lot of cmake code is needed to get stuff wrapped.

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


More information about the vtkusers mailing list