[vtkusers] Using VTK with CMake: link errors
Nicholas Kinar
n.kinar at usask.ca
Tue Aug 10 16:56:02 EDT 2010
> Try this
>
> target_link_libraries(fdtd-cuda-1 vtkHybrid)
>
> (that is, replace ${VTK_LIBS} with vtkHybrid)
>
> If that works you'll have to ask the CMake folks why what you did didn't work.
>
> Thanks,
>
> David
>
>
Hello David,
Thank you very much for your response; this is greatly appreciated! I
changed the line in my CMake file, and I now receive the following
error. Strangely enough, it now appears that CMake wants to link with a
library in the Mac OS X Python framework. Since this may be a CMake
problem, I'll try to download the most recent version of CMake. I may
also try to build CMake from SVN.
Here is the output from make after changing the line:
Linking CXX executable fdtd-cuda-1
ld: warning: in
/Library/Frameworks/Python.framework/Versions/6.1/lib/vtk-5.4/libvtkHybrid.dylib,
file was built for i386 which is not the architecture being linked (x86_64)
ld: warning: in
/Library/Frameworks/Python.framework/Versions/6.1/lib/vtk-5.4/libvtkRendering.dylib,
file was built for i386 which is not the architecture being linked (x86_64)
ld: warning: in
/Library/Frameworks/Python.framework/Versions/6.1/lib/vtk-5.4/libvtkGraphics.dylib,
file was built for i386 which is not the architecture being linked (x86_64)
ld: warning: in
/Library/Frameworks/Python.framework/Versions/6.1/lib/vtk-5.4/libvtkverdict.dylib,
file was built for i386 which is not the architecture being linked (x86_64)
ld: warning: in
/Library/Frameworks/Python.framework/Versions/6.1/lib/vtk-5.4/libvtkImaging.dylib,
file was built for i386 which is not the architecture being linked (x86_64)
ld: warning: in
/Library/Frameworks/Python.framework/Versions/6.1/lib/vtk-5.4/libvtkftgl.dylib,
file was built for i386 which is not the architecture being linked (x86_64)
ld: warning: in
/Library/Frameworks/Python.framework/Versions/6.1/lib/vtk-5.4/libvtkfreetype.dylib,
file was built for i386 which is not the architecture being linked (x86_64)
ld: warning: in
/Library/Frameworks/Python.framework/Versions/6.1/lib/vtk-5.4/libvtkIO.dylib,
file was built for i386 which is not the architecture being linked (x86_64)
ld: warning: in
/Library/Frameworks/Python.framework/Versions/6.1/lib/vtk-5.4/libvtkFiltering.dylib,
file was built for i386 which is not the architecture being linked (x86_64)
ld: warning: in
/Library/Frameworks/Python.framework/Versions/6.1/lib/vtk-5.4/libvtkCommon.dylib,
file was built for i386 which is not the architecture being linked (x86_64)
ld: warning: in
/Library/Frameworks/Python.framework/Versions/6.1/lib/vtk-5.4/libvtkDICOMParser.dylib,
file was built for i386 which is not the architecture being linked (x86_64)
ld: warning: in
/Library/Frameworks/Python.framework/Versions/6.1/lib/vtk-5.4/libvtkmetaio.dylib,
file was built for i386 which is not the architecture being linked (x86_64)
ld: warning: in
/Library/Frameworks/Python.framework/Versions/6.1/lib/vtk-5.4/libvtksqlite.dylib,
file was built for i386 which is not the architecture being linked (x86_64)
ld: warning: in
/Library/Frameworks/Python.framework/Versions/6.1/lib/vtk-5.4/libvtkpng.dylib,
file was built for i386 which is not the architecture being linked (x86_64)
ld: warning: in
/Library/Frameworks/Python.framework/Versions/6.1/lib/vtk-5.4/libvtktiff.dylib,
file was built for i386 which is not the architecture being linked (x86_64)
ld: warning: in
/Library/Frameworks/Python.framework/Versions/6.1/lib/vtk-5.4/libvtkzlib.dylib,
file was built for i386 which is not the architecture being linked (x86_64)
ld: warning: in
/Library/Frameworks/Python.framework/Versions/6.1/lib/vtk-5.4/libvtkjpeg.dylib,
file was built for i386 which is not the architecture being linked (x86_64)
ld: warning: in
/Library/Frameworks/Python.framework/Versions/6.1/lib/vtk-5.4/libvtkexpat.dylib,
file was built for i386 which is not the architecture being linked (x86_64)
ld: warning: in
/Library/Frameworks/Python.framework/Versions/6.1/lib/vtk-5.4/libvtksys.dylib,
file was built for i386 which is not the architecture being linked (x86_64)
ld: warning: in
/Library/Frameworks/Python.framework/Versions/6.1/lib/vtk-5.4/libvtkexoIIc.dylib,
file was built for i386 which is not the architecture being linked (x86_64)
ld: warning: in
/Library/Frameworks/Python.framework/Versions/6.1/lib/vtk-5.4/libvtkNetCDF.dylib,
file was built for i386 which is not the architecture being linked (x86_64)
Undefined symbols:
"vtkRenderer::New()", referenced from:
vtkSmartPointer<vtkRenderer>::New() in main.cpp.o
"vtkRenderWindowInteractor::SetRenderWindow(vtkRenderWindow*)",
referenced from:
test_VTK() in main.cpp.o
"vtkRenderer::ResetCamera()", referenced from:
test_VTK() in main.cpp.o
"vtkJPEGReader::New()", referenced from:
vtkSmartPointer<vtkJPEGReader>::New() in main.cpp.o
"vtkSmartPointerBase::vtkSmartPointerBase(vtkObjectBase*,
vtkSmartPointerBase::NoReference const&)", referenced from:
vtkSmartPointer<vtkJPEGReader>::vtkSmartPointer(vtkJPEGReader*,
vtkSmartPointerBase::NoReference const&)in main.cpp.o
vtkSmartPointer<vtkImageActor>::vtkSmartPointer(vtkImageActor*,
vtkSmartPointerBase::NoReference const&)in main.cpp.o
vtkSmartPointer<vtkRenderer>::vtkSmartPointer(vtkRenderer*,
vtkSmartPointerBase::NoReference const&)in main.cpp.o
vtkSmartPointer<vtkRenderWindow>::vtkSmartPointer(vtkRenderWindow*,
vtkSmartPointerBase::NoReference const&)in main.cpp.o
vtkSmartPointer<vtkRenderWindowInteractor>::vtkSmartPointer(vtkRenderWindowInteractor*,
vtkSmartPointerBase::NoReference const&)in main.cpp.o
vtkSmartPointer<vtkInteractorStyleImage>::vtkSmartPointer(vtkInteractorStyleImage*,
vtkSmartPointerBase::NoReference const&)in main.cpp.o
"vtkInteractorStyleImage::New()", referenced from:
vtkSmartPointer<vtkInteractorStyleImage>::New() in main.cpp.o
"vtkImageAlgorithm::GetOutput()", referenced from:
test_VTK() in main.cpp.o
"vtkRenderWindowInteractor::New()", referenced from:
vtkSmartPointer<vtkRenderWindowInteractor>::New() in
main.cpp.o
"vtkImageActor::New()", referenced from:
vtkSmartPointer<vtkImageActor>::New() in main.cpp.o
"vtkRenderWindow::New()", referenced from:
vtkSmartPointer<vtkRenderWindow>::New() in main.cpp.o
"vtkSmartPointerBase::~vtkSmartPointerBase()", referenced from:
vtkSmartPointer<vtkInteractorStyleImage>::~vtkSmartPointer()in
main.cpp.o
vtkSmartPointer<vtkRenderWindowInteractor>::~vtkSmartPointer()in
main.cpp.o
vtkSmartPointer<vtkRenderWindow>::~vtkSmartPointer()in main.cpp.o
vtkSmartPointer<vtkRenderer>::~vtkSmartPointer()in main.cpp.o
vtkSmartPointer<vtkImageActor>::~vtkSmartPointer()in main.cpp.o
vtkSmartPointer<vtkJPEGReader>::~vtkSmartPointer()in main.cpp.o
"vtkRenderer::AddActor(vtkProp*)", referenced from:
test_VTK() in main.cpp.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[2]: *** [fdtd-cuda-1] Error 1
make[1]: *** [CMakeFiles/fdtd-cuda-1.dir/all] Error 2
make: *** [all] Error 2
Thanks for your suggestion, David!
Nicholas
More information about the vtkusers
mailing list