0

我在 Ubuntu 10.04 上使用 Qt。在程序安装过程之后,我尝试按照此处 [http://www.vtk.org/Wiki/VTK/Examples/Instructions/ForUsers] 中的说明使用 vtk 示例对其进行测试。

但它给出了一个错误,如:

Starting /home/taha/Downloads/VTK/Examples/Tutorial/Step1/Cxx/Cone...
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
ERROR: In /home/taha/Downloads/VTK/Rendering/vtkXOpenGLRenderWindow.cxx, line 398
vtkXOpenGLRenderWindow (0x9812928): Could not find a decent visual


The program has unexpectedly finished.
/home/taha/Downloads/VTK/Examples/Tutorial/Step1/Cxx/Cone exited with code 0

如何解决这个问题?

4

1 回答 1

0

我个人的经验是您编写自己的 Makefile 并进行测试...供您参考,附上一个示例:

# paths 
bindir = ./
objdir = ./obj
vtkdir = /home/tool/vtk

# dependencies
object = main.o

obj = $(addprefix $(objdir)/,$(object))

# targets
exec = $(bindir)/exec

all: makedir $(exec)

# options
cxx = icpc

inc = -I. -I$vtkdir/vtk/Testing/Core -I$vtkdir/vtk/ExternalData/Objects -I$vtkdir/vtk/Views/Core -I$vtkdir/vtk/Views/Geovis -I$vtkdir/vtk/Views/Qt -I$vtkdir/vtk/Views/Infovis -I$vtkdir/vtk/Views/Context2D -I$vtkdir/vtk/Charts/Core -I$vtkdir/vtk/GUISupport/QtOpenGL -I$vtkdir/vtk/GUISupport/MFC -I$vtkdir/vtk/GUISupport/QtWebkit -I$vtkdir/vtk/GUISupport/Qt -I$vtkdir/vtk/GUISupport/QtSQL -I$vtkdir/vtk/Utilities/PythonInterpreter -I$vtkdir/vtk/Utilities/Benchmarks -I$vtkdir/vtk/Utilities/octree -I$vtkdir/vtk/Utilities/KWIML -I$vtkdir/vtk/Utilities/Maintenance -I$vtkdir/vtk/Utilities/DICOMParser -I$vtkdir/vtk/Utilities/vtkTclTest2Py -I$vtkdir/vtk/Utilities/OutputWindowProcess -I$vtkdir/vtk/Utilities/Rpm -I$vtkdir/vtk/Utilities/MetaIO -I$vtkdir/vtk/Utilities/Scripts -I$vtkdir/vtk/Utilities/Doxygen -I$vtkdir/vtk/Utilities/EncodeString -I$vtkdir/vtk/Utilities/KWSys -I$vtkdir/vtk/Utilities/HashSource -I$vtkdir/vtk/Utilities/ParseOGLExt -I$vtkdir/vtk/Utilities/Upgrading -I$vtkdir/vtk/Utilities/Python -I$vtkdir/vtk/Web/WebGLExporter -I$vtkdir/vtk/Web/Core -I$vtkdir/vtk/Web/Python -I$vtkdir/vtk/Accelerators/Vtkm -I$vtkdir/vtk/Rendering/LIC -I$vtkdir/vtk/Rendering/Tk -I$vtkdir/vtk/Rendering/VolumeAMR -I$vtkdir/vtk/Rendering/LICOpenGL2 -I$vtkdir/vtk/Rendering/Oculus -I$vtkdir/vtk/Rendering/Core -I$vtkdir/vtk/Rendering/ContextOpenGL2 -I$vtkdir/vtk/Rendering/Annotation -I$vtkdir/vtk/Rendering/VolumeOpenGL2 -I$vtkdir/vtk/Rendering/Label -I$vtkdir/vtk/Rendering/OptiX -I$vtkdir/vtk/Rendering/FreeType -I$vtkdir/vtk/Rendering/GL2PS -I$vtkdir/vtk/Rendering/OpenGL2 -I$vtkdir/vtk/Rendering/OpenVR -I$vtkdir/vtk/Rendering/SceneGraph -I$vtkdir/vtk/Rendering/External -I$vtkdir/vtk/Rendering/ParallelLIC -I$vtkdir/vtk/Rendering/Volume -I$vtkdir/vtk/Rendering/Image -I$vtkdir/vtk/Rendering/OSPRay -I$vtkdir/vtk/Rendering/Qt -I$vtkdir/vtk/Rendering/FreeTypeFontConfig -I$vtkdir/vtk/Rendering/GL2PSOpenGL2 -I$vtkdir/vtk/Rendering/Parallel -I$vtkdir/vtk/Rendering/LOD -I$vtkdir/vtk/Rendering/Context2D -I$vtkdir/vtk/Geovis/Core -I$vtkdir/vtk/Filters/Selection -I$vtkdir/vtk/Filters/ParallelStatistics -I$vtkdir/vtk/Filters/AMR -I$vtkdir/vtk/Filters/Verdict -I$vtkdir/vtk/Filters/Programmable -I$vtkdir/vtk/Filters/Sources -I$vtkdir/vtk/Filters/HyperTree -I$vtkdir/vtk/Filters/General -I$vtkdir/vtk/Filters/Core -I$vtkdir/vtk/Filters/Extraction -I$vtkdir/vtk/Filters/Geometry -I$vtkdir/vtk/Filters/Texture -I$vtkdir/vtk/Filters/OpenTurns -I$vtkdir/vtk/Filters/Statistics -I$vtkdir/vtk/Filters/ParallelVerdict -I$vtkdir/vtk/Filters/Points -I$vtkdir/vtk/Filters/ReebGraph -I$vtkdir/vtk/Filters/FlowPaths -I$vtkdir/vtk/Filters/Hybrid -I$vtkdir/vtk/Filters/Imaging -I$vtkdir/vtk/Filters/SMP -I$vtkdir/vtk/Filters/ParallelDIY2 -I$vtkdir/vtk/Filters/Modeling -I$vtkdir/vtk/Filters/Topology -I$vtkdir/vtk/Filters/Generic -I$vtkdir/vtk/Filters/ParallelGeometry -I$vtkdir/vtk/Filters/ParallelImaging -I$vtkdir/vtk/Filters/ParallelFlowPaths -I$vtkdir/vtk/Filters/ParallelMPI -I$vtkdir/vtk/Filters/Parallel -I$vtkdir/vtk/Filters/Python -I$vtkdir/vtk/ThirdParty/incremental -I$vtkdir/vtk/ThirdParty/freerange -I$vtkdir/vtk/ThirdParty/utf8 -I$vtkdir/vtk/ThirdParty/mpi4py -I$vtkdir/vtk/ThirdParty/sqlite -I$vtkdir/vtk/ThirdParty/gl2ps -I$vtkdir/vtk/ThirdParty/png -I$vtkdir/vtk/ThirdParty/ZopeInterface -I$vtkdir/vtk/ThirdParty/expat -I$vtkdir/vtk/ThirdParty/tiff -I$vtkdir/vtk/ThirdParty/jpeg -I$vtkdir/vtk/ThirdParty/TclTk -I$vtkdir/vtk/ThirdParty/VPIC -I$vtkdir/vtk/ThirdParty/netcdf -I$vtkdir/vtk/ThirdParty/SixPython -I$vtkdir/vtk/ThirdParty/constantly -I$vtkdir/vtk/ThirdParty/vtkm -I$vtkdir/vtk/ThirdParty/diy2 -I$vtkdir/vtk/ThirdParty/exodusII -I$vtkdir/vtk/ThirdParty/AutobahnPython -I$vtkdir/vtk/ThirdParty/xdmf2 -I$vtkdir/vtk/ThirdParty/wslink -I$vtkdir/vtk/ThirdParty/Twisted -I$vtkdir/vtk/ThirdParty/hdf5 -I$vtkdir/vtk/ThirdParty/verdict -I$vtkdir/vtk/ThirdParty/txaio -I$vtkdir/vtk/ThirdParty/xdmf3 -I$vtkdir/vtk/ThirdParty/lz4 -I$vtkdir/vtk/ThirdParty/glew -I$vtkdir/vtk/ThirdParty/freetype -I$vtkdir/vtk/ThirdParty/zfp -I$vtkdir/vtk/ThirdParty/jsoncpp -I$vtkdir/vtk/ThirdParty/hyperlink -I$vtkdir/vtk/ThirdParty/netcdfcpp -I$vtkdir/vtk/ThirdParty/oggtheora -I$vtkdir/vtk/Domains/ChemistryOpenGL2 -I$vtkdir/vtk/Domains/Chemistry -I$vtkdir/vtk/Domains/Microscopy -I$vtkdir/vtk/Imaging/Sources -I$vtkdir/vtk/Imaging/Morphological -I$vtkdir/vtk/Imaging/General -I$vtkdir/vtk/Imaging/Core -I$vtkdir/vtk/Imaging/Statistics -I$vtkdir/vtk/Imaging/OpenGL2 -I$vtkdir/vtk/Imaging/Stencil -I$vtkdir/vtk/Imaging/Color -I$vtkdir/vtk/Imaging/Fourier -I$vtkdir/vtk/Imaging/Hybrid -I$vtkdir/vtk/Imaging/Math -I$vtkdir/vtk/IO/XMLParser -I$vtkdir/vtk/IO/ADIOS -I$vtkdir/vtk/IO/EnSight -I$vtkdir/vtk/IO/AMR -I$vtkdir/vtk/IO/NetCDF -I$vtkdir/vtk/IO/LAS -I$vtkdir/vtk/IO/ParallelXML -I$vtkdir/vtk/IO/FFMPEG -I$vtkdir/vtk/IO/PLY -I$vtkdir/vtk/IO/GDAL -I$vtkdir/vtk/IO/LSDyna -I$vtkdir/vtk/IO/VPIC -I$vtkdir/vtk/IO/PDAL -I$vtkdir/vtk/IO/Core -I$vtkdir/vtk/IO/Geometry -I$vtkdir/vtk/IO/ParallelNetCDF -I$vtkdir/vtk/IO/Xdmf3 -I$vtkdir/vtk/IO/PostgreSQL -I$vtkdir/vtk/IO/MySQL -I$vtkdir/vtk/IO/XML -I$vtkdir/vtk/IO/SQL -I$vtkdir/vtk/IO/MINC -I$vtkdir/vtk/IO/MPIImage -I$vtkdir/vtk/IO/GeoJSON -I$vtkdir/vtk/IO/Video -I$vtkdir/vtk/IO/ParallelXdmf3 -I$vtkdir/vtk/IO/SegY -I$vtkdir/vtk/IO/TecplotTable -I$vtkdir/vtk/IO/Image -I$vtkdir/vtk/IO/ParallelExodus -I$vtkdir/vtk/IO/Legacy -I$vtkdir/vtk/IO/Infovis -I$vtkdir/vtk/IO/Import -I$vtkdir/vtk/IO/ParallelLSDyna -I$vtkdir/vtk/IO/MPIParallel -I$vtkdir/vtk/IO/Xdmf2 -I$vtkdir/vtk/IO/ODBC -I$vtkdir/vtk/IO/Exodus -I$vtkdir/vtk/IO/Export -I$vtkdir/vtk/IO/ExportOpenGL -I$vtkdir/vtk/IO/TRUCHAS -I$vtkdir/vtk/IO/ExportOpenGL2 -I$vtkdir/vtk/IO/Movie -I$vtkdir/vtk/IO/Parallel -I$vtkdir/vtk/Infovis/BoostGraphAlgorithms -I$vtkdir/vtk/Infovis/Core -I$vtkdir/vtk/Infovis/Boost -I$vtkdir/vtk/Infovis/Layout -I$vtkdir/vtk/Interaction/Style -I$vtkdir/vtk/Interaction/Widgets -I$vtkdir/vtk/Interaction/Image -I$vtkdir/vtk/Common/Transforms -I$vtkdir/vtk/Common/Core -I$vtkdir/vtk/Common/ComputationalGeometry -I$vtkdir/vtk/Common/System -I$vtkdir/vtk/Common/Color -I$vtkdir/vtk/Common/DataModel -I$vtkdir/vtk/Common/Misc -I$vtkdir/vtk/Common/Math -I$vtkdir/vtk/Common/ExecutionModel -I$vtkdir/vtk/Wrapping/Java -I$vtkdir/vtk/Wrapping/Tcl -I$vtkdir/vtk/Wrapping/Tools -I$vtkdir/vtk/Wrapping/PythonCore -I$vtkdir/vtk/Wrapping/Python -I$vtkdir/vtk/Parallel/MPI -I$vtkdir/vtk/Parallel/Core -I$vtkdir/vtk/Parallel/MPI4Py -I$vtkdir/paraview/ParaViewCore/Animation -I$vtkdir/paraview/ParaViewCore/CinemaReader -I$vtkdir/paraview/ParaViewCore/VTKExtensions -I$vtkdir/paraview/ParaViewCore/ClientServerCore -I$vtkdir/paraview/ParaViewCore/ClientServerStream -I$vtkdir/paraview/ParaViewCore/Common -I$vtkdir/paraview/ParaViewCore/ServerImplementation -I$vtkdir/paraview/ParaViewCore/ServerManager -I$vtkdir/paraview/Wrapping/ClientServer -I$vtkdir/qt5/5.10.1/gcc_64/include -I$vtkdir/qt5/5.10.1/gcc_64/include/QtWidgets -I$vtkdir/qt5/5.10.1/gcc_64/include/QtGui -I$vtkdir/qt5/5.10.1/gcc_64/include/QtCore -I. -isystem /usr/include/libdrm -I. -I$vtkdir/qt5/5.10.1/gcc_64/mkspecs/linux-g++

lflags = \
    -mkl \
    -qopenmp \
    -lstdc++ \
    -L$vtkdir/vtk/lib -lvtkIOLegacy-8.1 -lvtkInteractionWidgets-8.1 -lvtkRenderingQt-8.1 -lvtkImagingColor-8.1 -lvtkInteractionImage-8.1 -lvtkproj4-8.1 -lvtkoggtheora-8.1 -lvtkhdf5-8.1 -lvtkImagingSources-8.1 -lvtkParallelCore-8.1 -lvtkIOExport-8.1 -lvtkIOGeometry-8.1 -lvtkRenderingFreeType-8.1 -lvtkIOVideo-8.1 -lvtkInfovisCore-8.1 -lvtkGUISupportQt-8.1 -lvtkFiltersTexture-8.1 -lvtkRenderingGL2PSOpenGL2-8.1 -lvtkImagingStencil-8.1 -lvtkDICOMParser-8.1 -lvtkFiltersCore-8.1 -lvtkIOPLY-8.1 -lvtkImagingGeneral-8.1 -lvtkRenderingVolumeOpenGL2-8.1 -lvtktiff-8.1 -lvtkCommonSystem-8.1 -lvtkCommonMath-8.1 -lvtkInteractionStyle-8.1 -lvtkImagingFourier-8.1 -lvtkIOAMR-8.1 -lvtkCommonComputationalGeometry-8.1 -lvtkglew-8.1 -lvtkFiltersSources-8.1 -lvtkmetaio-8.1 -lvtkRenderingCore-8.1 -lvtkjsoncpp-8.1 -lvtkGeovisCore-8.1 -lvtkIOImport-8.1 -lvtkCommonMisc-8.1 -lvtkRenderingAnnotation-8.1 -lvtkImagingMorphological-8.1 -lvtkFiltersSMP-8.1 -lvtkRenderingOpenGL2-8.1 -lvtksqlite-8.1 -lvtkFiltersHyperTree-8.1 -lvtkFiltersTopology-8.1 -lvtkNetCDF-8.1 -lvtkFiltersImaging-8.1 -lvtkIOMINC-8.1 -lvtkIOXML-8.1 -lvtkFiltersParallelImaging-8.1 -lvtkFiltersSelection-8.1 -lvtkImagingMath-8.1 -lvtkFiltersGeometry-8.1 -lvtkFiltersVerdict-8.1 -lvtkRenderingLabel-8.1 -lvtknetcdfcpp-8.1 -lvtkViewsQt-8.1 -lvtkImagingCore-8.1 -lvtkFiltersStatistics-8.1 -lvtkImagingStatistics-8.1 -lvtkFiltersGeneral-8.1 -lvtklibharu-8.1 -lvtklibxml2-8.1 -lvtkInfovisLayout-8.1 -lvtkpng-8.1 -lvtkFiltersFlowPaths-8.1 -lvtkCommonTransforms-8.1 -lvtkCommonExecutionModel-8.1 -lvtkViewsInfovis-8.1 -lvtkexoIIc-8.1 -lvtkIOSQL-8.1 -lvtkFiltersPoints-8.1 -lvtkDomainsChemistryOpenGL2-8.1 -lvtkIOXMLParser-8.1 -lvtkfreetype-8.1 -lvtkalglib-8.1 -lvtkFiltersParallel-8.1 -lvtkIOEnSight-8.1 -lvtkFiltersGeneric-8.1 -lvtkRenderingContextOpenGL2-8.1 -lvtkRenderingContext2D-8.1 -lvtkFiltersHybrid-8.1 -lvtkIONetCDF-8.1 -lvtkGUISupportQtSQL-8.1 -lvtkjpeg-8.1 -lvtkIOTecplotTable-8.1 -lvtkgl2ps-8.1 -lvtkViewsContext2D-8.1 -lvtkRenderingLOD-8.1 -lvtkIOParallelXML-8.1 -lvtkIOImage-8.1 -lvtkverdict-8.1 -lvtklz4-8.1 -lvtkFiltersProgrammable-8.1 -lvtkDomainsChemistry-8.1 -lvtkChartsCore-8.1 -lvtkzlib-8.1 -lvtkImagingHybrid-8.1 -lvtkViewsCore-8.1 -lvtkFiltersExtraction-8.1 -lvtkCommonDataModel-8.1 -lvtkIOInfovis-8.1 -lvtkFiltersAMR-8.1 -lvtkIOExodus-8.1 -lvtkIOLSDyna-8.1 -lvtkCommonCore-8.1 -lvtkRenderingVolume-8.1 -lvtkCommonColor-8.1 -lvtkIOParallel-8.1 -lvtkexpat-8.1 -lvtkFiltersModeling-8.1 -lvtkIOMovie-8.1 -lvtksys-8.1 -lvtkhdf5_hl-8.1 -lvtkIOCore-8.1 -lvtkIOExportOpenGL2-8.1 -lvtkRenderingImage-8.1 -L$vtkdir/qt5/5.10.1/gcc_64/lib -lGL -lpthread 

ccflags = -O3 -w -qopenmp 

# compile
$(objdir)/%.o : ./%.cpp
    $(cxx) -o $@ -c $(ccflags) $(inc) $<

# link
$(exec) : $(obj)
    $(cxx) -o $@ $^ $(lflags) $(inc)

# make directory
makedir:
    -@mkdir -p $(bindir)
    -@mkdir -p $(objdir)

# clean
clean:
    -@rm -rf $(objdir)/*.o
于 2018-11-11T02:13:47.437 回答