[Paraview-developers] Linker error with custom plugin

Grégory Zaccaro gregory.zaccaro at gmail.com
Sat Nov 19 19:44:22 EST 2016


Hello,

I have troubles to compile a custom plugin which instantiate another custom
plugin.
Let's say I want to build a custom plugin A which uses another custom
plugin B. Right now, I get linker errors when compiling plugin A. I built
Paraview from sources with "BUILD_SHARED_LIBS = ON".


The Cmake file of the plugin A looks like this :

PROJECT(FilterA)

INCLUDE_DIRECTORIES(${VTK_INCLUDE_DIRS})
FIND_PACKAGE(ParaView REQUIRED)
INCLUDE(${PARAVIEW_USE_FILE})

INCLUDE(ParaViewBranding)
INCLUDE(ParaViewPlugins)

ADD_PARAVIEW_PLUGIN(FilterA "1.0"
 SERVER_MANAGER_XML vtkFilterA.xml
 SERVER_MANAGER_SOURCES vtkFilterA.cxx)

#FIND_LIBRARY(FilterB NAMES FilterB NO_MODULE)
#TARGET_LINK_LIBRARIES(FilterA LINK_PRIVATE FilterB)


The Cmake file of the plugin B looks like this :

PROJECT(FilterB)
INCLUDE_DIRECTORIES(${VTK_INCLUDE_DIRS})
ADD_PARAVIEW_PLUGIN(FilterB "1.0"
 SERVER_MANAGER_XML vtkFilterB.xml
 SERVER_MANAGER_SOURCES vtkFilterB.cxx)


In Visual Studio, I can see FilterB.lib in the list of the additionnal
dependencies but I still get the linkage errors.

I managed to solve the problem by manually add FilterB.obj to the
additionnal dependencies of plugin A. But I didn't figured out how can I
set Cmake to link the two plugins.

Any help would be appreciated !

Kind regards,
Gregory
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20161119/9df9084f/attachment.html>


More information about the Paraview-developers mailing list