[Paraview-developers] how do I link library to my reader plugin?
Joshua Murphy
Joshua.Murphy at lasp.colorado.edu
Wed Nov 7 14:43:45 EST 2012
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
[cid:DD991949-2449-49DA-97DD-0219C5774392]
Joshua J. Murphy
Computer Scientist
Laboratory for Atmospheric and Space Physics
University of Colorado, Boulder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20121107/68874859/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: A93D829A-3C2C-4769-925A-35900ECAAE2C[3].png
Type: image/png
Size: 16467 bytes
Desc: A93D829A-3C2C-4769-925A-35900ECAAE2C[3].png
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20121107/68874859/attachment-0001.png>
More information about the Paraview-developers
mailing list