我试着用夸脱建造osgEarth。官方网站上的说明如下:
将QT_QMAKE_EXECUTABLE CMake变量指向要使用的qmake.exe,CMake将填充所有其他QT变量。
好的。我所做的工作如下:
cmake -D QT_QMAKE_EXECUTABLE=/Users/garbart/Qt/5.10.0/clang_64/bin/qmake CMakeLists.txt
make并得到以下错误:
[ 19%] Built target osgEarth
[ 25%] Built target osgEarthSymbology
[ 32%] Built target osgEarthFeatures
[ 35%] Built target osgEarthAnnotation
[ 44%] Built target osgEarthUtil
[ 44%] Building CXX object src/osgEarthQt/CMakeFiles/osgEarthQt5.dir/ViewerWidget.cpp.o
In file included from /Users/garbart/Desktop/osgearth-master/src/osgEarthQt/ViewerWidget.cpp:31:
In file included from /Users/garbart/Qt/5.10.0/clang_64/lib/QtGui.framework/Headers/QtGui:45:
In file included from /Users/garbart/Qt/5.10.0/clang_64/lib/QtGui.framework/Headers/qopenglcontext.h:61:
/Users/garbart/Qt/5.10.0/clang_64/lib/QtGui.framework/Headers/qopenglversionfunctions.h:1089:23: error:
unknown type name 'GLDEBUGPROC'
QT_OPENGL_DECLARE(QT_OPENGL_4_3_FUNCTIONS);
^
In file included from /Users/garbart/Desktop/osgearth-master/src/osgEarthQt/ViewerWidget.cpp:31:
In file included from /Users/garbart/Qt/5.10.0/clang_64/lib/QtGui.framework/Headers/QtGui:47:
/Users/garbart/Qt/5.10.0/clang_64/lib/QtGui.framework/Headers/qopenglextrafunctions.h:472:33: error:
unknown type name 'GLDEBUGPROC'
void glDebugMessageCallback(GLDEBUGPROC callback, const void *userParam);
^
/Users/garbart/Qt/5.10.0/clang_64/lib/QtGui.framework/Headers/qopenglextrafunctions.h:758:23: error:
unknown type name 'GLDEBUGPROC'
QT_OPENGL_DECLARE(QT_OPENGL_EXTRA_FUNCTIONS)
^
/Users/garbart/Qt/5.10.0/clang_64/lib/QtGui.framework/Headers/qopenglextrafunctions.h:2213:59: error:
unknown type name 'GLDEBUGPROC'
inline void QOpenGLExtraFunctions::glDebugMessageCallback(GLDEBUGPROC ca...
^
4 errors generated.
make[2]: *** [src/osgEarthQt/CMakeFiles/osgEarthQt5.dir/ViewerWidget.cpp.o] Error 1
make[1]: *** [src/osgEarthQt/CMakeFiles/osgEarthQt5.dir/all] Error 2
make: *** [all] Error 2QT 5.10.0 osgEarth 2.10
发布于 2018-10-04 08:20:08
我就是这样构建OSG、osgQt和osgEarth的。
获取OSG,配置和构建:
git clone --branch OpenSceneGraph-3.6.2 https://github.com/openscenegraph/OpenSceneGraph.git
mkdir osg-build
cd osg-build
cmake ../OpenSceneGraph
make
sudo make install获取osgQt、配置和构建:
git clone https://github.com/openscenegraph/osgQt.git
mkdir osgqt-build
cd osgqt-build
cmake ../osgQt -DCMAKE_PREFIX_PATH=/opt/Qt/5.6.3/gcc_64/lib/cmake
make
sudo make install这最后一步可能无法构建,因为osgQt没有跟上OSG的步伐。
您需要编辑CMakeLists.txt并设置查找Qt和OSG的目录路径。CMakeLists.txt还硬引用一个特定版本的OSG,这将需要修改。关于这些问题的清单上已经有了很多讨论,所以这可能是根据你阅读这篇文章的时候来排序的。
git clone https://github.com/gwaldron/osgearth.git
mkdir osgearth-build
cd osgearth-build
cmake ../osgearth -DCMAKE_PREFIX_PATH=/opt/Qt/5.6.3/gcc_64/lib/cmake使用ccmake .使用以下设置配置生成:
OSGEARTH_QT_BUILD ON
OSGEARTH_QT_BUILD_LEGACY_WIDGE ON构建和安装:
make
sudo make install注意:QT5.11也应该有效。
更新:2020年6月2日
自我最初的文章以来,osgQt存储库已经发生了很大的变化。
这意味着osgEarth 2.10 Qt将不使用osgQt构建。您可能需要使用Qt4标记。
较新版本的osgEarth不再有任何Qt支持。
用于将OSG/osgEarth与Qt集成在一起的方法充其量是一种折衷方案。
我建议创建一个独立的OpenGL上下文,OSG/osgEarth使用该上下文将其呈现到屏幕外缓冲区中(两个用于在显示另一个缓冲区时进行绘图)。然后,Qt3D使用不同的OpenGL contex显示屏幕外缓冲区。
这是一种更明智的方法,因为这将允许OSG/osgEarth使用多个线程。
目前,Qt和OSG/osgEarth正在共享OpenGL上下文。
一个起点是下面的文章[https://embeddeddevelop.blogspot.com/2017/06/integrating-opengl-and-qtpainter.html] (免责声明我的博客)。
发布于 2018-05-11 10:37:46
请正确地遵守命令。
https://stackoverflow.com/questions/50018381
复制相似问题