我改为VTK-6,现在因为找不到库而无法再编译..使用vtk-5它完全正常。
c++ -o loch -Wall lxTR.o lxOGLFT.o lxSetup.o lxRender.o lxWX.o lxImgIO.o lxLRUD.o lxFile.o lxSTree.o lxData.o lxMath.o lxSView.o lxSScene.o lxGUI.o lxGLC.o lxOptDlg.o lxAboutDlg.o img.o -lz -L/usr/X11R6/lib -lwx_osx_cocoau_gl-2.9 -L/usr/local/Cellar/wxmac/2.9.5.0/lib -framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework System -framework OpenGL -framework QuickTime -lwx_osx_cocoau-2.9 -L/usr/local/lib -lvtkHybrid -lvtkImaging -lvtkIO -lvtkGraphics -lvtkFiltering -lvtkCommon -lvtkjpeg -lvtkpng -lvtkzlib -lvtksys -lfreetype
ld: library not found for -lvtkHybrid
知道他们改变了什么吗?
答案 0 :(得分:2)
似乎VTK 6中的组件库发生了变化:有关详细信息,请参阅wiki page。例如,配置为使用cmake链接VTK中的所有内容后,VTK_LIBRARIES
变量将设置为以下要链接的库列表:
vtkalglib;vtkChartsCore;vtkCommonColor;vtkCommonDataModel;vtkCommonMath;vtkCommonCore;vtksys;vtkCommonMisc;vtkCommonSystem;vtkCommonTransforms;vtkInfovisCore;vtkFiltersExtraction;vtkCommonExecutionModel;vtkFiltersCore;vtkFiltersGeneral;vtkCommonComputationalGeometry;vtkFiltersStatistics;vtkImagingFourier;vtkImagingCore;vtkRenderingContext2D;vtkRenderingCore;vtkFiltersGeometry;vtkFiltersSources;vtkIOImage;vtkDICOMParser;vtkIOCore;vtkzlib;vtkmetaio;vtkjpeg;vtkpng;vtktiff;vtkIOXMLParser;vtkexpat;vtkRenderingFreeType;vtkfreetype;vtkftgl;vtkRenderingOpenGL;vtkImagingHybrid;vtkDomainsChemistry;vtkIOXML;vtkIOGeometry;vtkjsoncpp;vtkexoIIc;vtkNetCDF;vtkNetCDF_cxx;vtkhdf5_hl;vtkhdf5;vtkFiltersAMR;vtkParallelCore;vtkIOLegacy;vtkFiltersFlowPaths;vtkFiltersGeneric;vtkFiltersHybrid;vtkImagingSources;vtkFiltersHyperTree;vtkFiltersImaging;vtkImagingGeneral;vtkFiltersModeling;vtkFiltersParallel;vtkFiltersParallelImaging;vtkFiltersProgrammable;vtkFiltersSelection;vtkFiltersTexture;vtkFiltersVerdict;verdict;vtkGeovisCore;vtkInfovisLayout;vtkInteractionStyle;vtkInteractionWidgets;vtkRenderingAnnotation;vtkImagingColor;vtkRenderingVolume;vtkViewsCore;vtkproj4;vtkgl2ps;vtkGUISupportQt;vtkGUISupportQtOpenGL;vtkImagingMath;vtkImagingMorphological;vtkImagingStatistics;vtkImagingStencil;vtkInteractionImage;vtkIOAMR;vtkIOEnSight;vtkIOExodus;vtkIOExport;vtkRenderingGL2PS;vtkIOImport;vtkIOInfovis;vtklibxml2;vtkIOLSDyna;vtkIOMINC;vtkIOMovie;vtkoggtheora;vtkIONetCDF;vtkIOParallel;vtkIOPLY;vtkIOSQL;vtksqlite;vtkIOVideo;vtkRenderingFreeTypeOpenGL;vtkRenderingHybridOpenGL;vtkRenderingImage;vtkRenderingLabel;vtkRenderingLOD;vtkRenderingVolumeAMR;vtkRenderingVolumeOpenGL;vtkViewsContext2D;vtkViewsGeovis;vtkViewsInfovis
请注意,vtkCommon
和vtkHybrid
已不在命名列表中,因为它已经重新组织,因此您需要调整链接的库。
答案 1 :(得分:0)
试试这个。
static
{
vtkNativeLibrary.LoadAllNativeLibraries();//Try to load all library
}
vtkNativeLibrary类用于更轻松地加载本机库。
而非平时
static {
//System.loadLibrary("vtkCommonJava");
//System.loadLibrary("vtkFilteringJava");
//System.loadLibrary("vtkIOJava");
//System.loadLibrary("vtkImagingJava");
//System.loadLibrary("vtkGraphicsJava");
//System.loadLibrary("vtkRenderingJava");
}
仅适用于较旧版本的VTK而不适用于VTK6版本