[Paraview-developers] Linker error with custom plugin

Cory Quammen cory.quammen at kitware.com
Mon Nov 28 13:17:59 EST 2016


Gregory,

I assume you are getting linker errors when the code

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

is uncommented. Is that correct?

Are your two plugins in two different CMake projects, or are they in
one project?

My suggestion would be to have them in one project with a top-level
CMakeLists.txt file that adds the B filter subdirectory before the A
filter subdirectory, then uncommenting those lines above.

HTH,
Cory



On Sat, Nov 19, 2016 at 7:44 PM, Grégory Zaccaro
<gregory.zaccaro at gmail.com> wrote:
> 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
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Search the list archives at:
> http://markmail.org/search/?q=Paraview-developers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview-developers
>



-- 
Cory Quammen
Staff R&D Engineer
Kitware, Inc.


More information about the Paraview-developers mailing list