[Paraview-developers] how do I link library to my reader plugin?

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Wed Nov 7 14:59:48 EST 2012


Can you post the error that you are seeing now? Thanks.


On Wed, Nov 7, 2012 at 2:58 PM, Joshua Murphy <
Joshua.Murphy at lasp.colorado.edu> wrote:

> I have figured out the vtkRenderingMatplotlib linking problem, but still
> cannot seem to link my own library correctly…
>
> -Josh
>
>
> From: Joshua Murphy <Joshua.Murphy at lasp.colorado.edu>
> Date: Wednesday, November 7, 2012 1:43 PM
> To: "paraview-developers at paraview.org" <paraview-developers at paraview.org>
> Subject: [Paraview-developers] how do I link library to my reader plugin?
>
> Hello,
>
> I have a quick question, that I hope someone can answer quickly.
>
> I am trying to add the NASA cxform library to my reader (ParaView 3.98
> RC1) so I can do some transformation, but I can running into some problems.
>
> I have the following CMake files:
>
> Project:
>
> CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
> PROJECT("Enlil Reader 2.0.1")
>
> #SET(ParaView_DIR /Users/sysop/Developer/pv/build)
> SET(ParaView_DIR
> /Volumes/Data/Development/ParaView-src/git-version/build-2Nov12)
> #SET(ParaView_DIR
> /Volumes/Data/Development/ParaView/git-clean/build-13595/)
>
>     set(CMAKE_CXX_FLAGS "-O3")        ## Optimize
>     set(CMAKE_EXE_LINKER_FLAGS "-s")  ## Strip binary
>
> FIND_PACKAGE(ParaView REQUIRED)
> INCLUDE(${PARAVIEW_USE_FILE})
>
>
> ADD_SUBDIRECTORY(cxform-0.71)
>
> Find_Library(cxform REQUIRED)
>
> include_directories(cxform-0.71)
>
> Add_Executable(cxtest cxform-0.71/main.c)
> target_link_libraries(cxtest cxform)
>
>
> ADD_PARAVIEW_PLUGIN(vtkEnlilReader "2.0.1"
>   SERVER_MANAGER_XML vtkEnlilReader.xml
>   SERVER_MANAGER_SOURCES vtkEnlilReader.cxx
>   SOURCES DateTime.C
>   GUI_RESOURCE_FILES vtkEnlilGUI.xml)
>
> SET(KIT_LIBS cxform vtkNetCDF_cxx)
>
> Target_LINK_LIBRARIES(vtkEnlilReader ${ParaView_LIBRARIES} ${KIT_LIBS})
>
> ================================================================
> And my Library CMAKE file:
>
> CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
> PROJECT("CXForm - Enlil")
>
> add_library(
>             cxform
>             STATIC
>             cxform-auto.c
>             cxform-manual.c
>             )
>
>
> ================================================================
>
> My test executable links fine,and runs fine, but the plugin gives me the
> following error:
>
> 12:38:31: Running steps for project Enlil Reader 2.0.1...
>
> 12:38:31: Starting: "/usr/bin/make"
>
> -- Configuring done
>
> -- Generating done
>
> -- Build files have been written to:
> /Volumes/Data/Development/vtkPlugins/PV4-201-build
>
> [ 11%] Built target cxform
>
> [ 17%] Built target cxtest
>
> [ 23%] Generating qrc_vtkEnlilReader.cxx
>
> Scanning dependencies of target vtkEnlilReader
>
> [ 29%] Building CXX object
> CMakeFiles/vtkEnlilReader.dir/qrc_vtkEnlilReader.cxx.o
>
> Linking CXX shared library libvtkEnlilReader.dylib
>
> Undefined symbols for architecture x86_64:
>
> "gregorian_calendar_to_jd(int, int, int, int, int, int)", referenced from:
>
> vtkEnlilReader::calculateArtifacts() in vtkEnlilReader.cxx.o
>
> "date2es(int, int, int, int, int, int)", referenced from:
>
> vtkEnlilReader::calculateArtifacts() in vtkEnlilReader.cxx.o
>
> "vtkRenderingMatplotlib_AutoInit_Construct()", referenced from:
>
> global constructors keyed to _Z38vtkEnlilReadervtkEnlilReaderInterfacesvin
> vtkEnlilReader_Plugin.cxx.o
>
> global constructors keyed to
> _ZN21vtkEnlilReader_Plugin18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPvin
> moc_vtkEnlilReader_Plugin.cxx.o
>
> "vtkRenderingMatplotlib_AutoInit_Destruct()", referenced from:
>
> ___tcf_7 in vtkEnlilReader_Plugin.cxx.o
>
> ___tcf_5 in moc_vtkEnlilReader_Plugin.cxx.o
>
> ld: symbol(s) not found for architecture x86_64
>
> collect2: ld returned 1 exit status
>
> make[2]: *** [libvtkEnlilReader.dylib] Error 1
>
> make[1]: *** [CMakeFiles/vtkEnlilReader.dir/all] Error 2
>
> make: *** [all] Error 2
>
> 12:38:32: The process "/usr/bin/make" exited with code 2.
>
> Error while building/deploying project Enlil Reader 2.0.1 (target: Desktop)
>
> When executing step 'Make'
>
>
> Can someone tell me how to properly link to my library?
>
> Thanks,
> Josh
>
> Joshua J. Murphy
> Computer Scientist
> Laboratory for Atmospheric and Space Physics
> University of Colorado, Boulder
>
>
>
>
>
>
> _______________________________________________
> Paraview-developers mailing list
> Paraview-developers at paraview.org
> http://public.kitware.com/mailman/listinfo/paraview-developers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20121107/fda3d2d7/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 16467 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20121107/fda3d2d7/attachment-0001.png>


More information about the Paraview-developers mailing list