<div dir="ltr">Hi Armin,<div><br></div><div>Wrapping classes within the VTK source tree itself is pretty trivial.</div><div>Someone should write some cmake macros to make it equally</div><div>trivial for users to wrap their own classes (I'd do it myself, but I've</div><div>already got way too many projects on my plate).</div><div><br></div><div> - David</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 27, 2015 at 9:37 AM, Armin Wehrfritz <span dir="ltr"><<a href="mailto:dkxls23@gmail.com" target="_blank">dkxls23@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks a lot for for your help David!<br>
<br>
I added some of the missing statements in a quick-and-dirty trial and eventually got rid of the real_initvtkMyFilterPython symbol error.<br>
<br>
However, I immediately ran into a new symbol error. So I'm still missing some linking targets...<br>
<br>
I will have a closer look at how it's done in VTK-dicom and see if I can figure out what I'm missing.<br>
<br>
I should probably also mention that these were my first steps compiling a VTK filter and I could be missing some things on that end. So far I always used boost for my C++/python coding directly.<br>
<br>
Initially I hope the python wrapping in VTK would be as easy as with boost, but there really seems to be much more CMAKE code required than I thought.<span class="HOEnZb"><font color="#888888"><br>
<br>
-Armin</font></span><span class=""><br>
<br>
<br>
<br>
<br>
<br>
<br>
On 03/26/2015 06:44 PM, David Gobbi wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
On Thu, Mar 26, 2015 at 10:07 AM, David Gobbi <<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a><br></span><span class="">
<mailto:<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>><u></u>> wrote:<br>
<br>
<br>
<br>
    On Thu, Mar 26, 2015 at 9:57 AM, David Gobbi <<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a><br></span><span class="">
    <mailto:<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>><u></u>> wrote:<br>
<br>
        On Thu, Mar 26, 2015 at 9:25 AM, Armin Wehrfritz<br></span><span class="">
        <<a href="mailto:dkxls23@gmail.com" target="_blank">dkxls23@gmail.com</a> <mailto:<a href="mailto:dkxls23@gmail.com" target="_blank">dkxls23@gmail.com</a>>> wrote:<br>
<br>
<br>
                ImportError: ./vtkMyFilterPython.so: :<br>
                real_initvtkMyFilterPython<br>
<br>
<br>
        The undefined symbol error probably means that your python<br>
        module doesn't include vtkMyFilterPythonInit.cxx, which is one<br>
        of the files generated by vtk_wrap_python3().<br>
<br>
        Your cmake should include the Init.cxx as a source file when it<br>
        builds the module, e.g.:<br>
<br>
        add_library(vtkMyFilterPython MODULE vtkMyFilterPythonInit.cxx)<br>
<br>
        Or, if that still doesn't fix the problem, then there might be<br>
        an error in your add_library call for vtkMyFilterPythonD.<br>
<br>
<br>
    Oh, and the following lines are also necessary, but only if you<br>
    build a static library:<br>
<br>
    set_target_properties(<u></u>vtkMyFilter PROPERTIES<br>
    POSITION_INDEPENDENT_CODE ON)<br>
    set_target_properties(<u></u>vtkMyFilterPythonD PROPERTIES<br>
    POSITION_INDEPENDENT_CODE ON)<br>
<br>
<br>
I forgot the the line that is probably the most likely to fix the<br>
real_initvtkMyFilterPython symbol error:<br>
<br>
   target_link_libraries(<u></u>vtkMyFilterPython vtkMyFilterPythonD)<br>
<br>
In summary, a lot of cmake code is needed to get stuff wrapped.<br>
<br>
  - David<br>
<br>
<br>
<br></span><span class="">
______________________________<u></u>_________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/<u></u>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_<u></u>FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" target="_blank">http://markmail.org/search/?q=<u></u>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" target="_blank">http://public.kitware.com/<u></u>mailman/listinfo/vtkusers</a><br>
<br>
</span></blockquote><div class="HOEnZb"><div class="h5">
______________________________<u></u>_________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/<u></u>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_<u></u>FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" target="_blank">http://markmail.org/search/?q=<u></u>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" target="_blank">http://public.kitware.com/<u></u>mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br></div>