Makefile CGAL演示未运行

Makefile CGAL演示未运行,makefile,cmake,cgal,fpic,qglviewer,Makefile,Cmake,Cgal,Fpic,Qglviewer,我已经试着让他们工作了一段时间。在安装了库(通过tarball)并通过cmakegui安装了我发现需要的每个依赖项之后,我设法使示例和一些2D演示正常工作 我可以运行三角剖分和多边形演示,但当我尝试制作多面体演示时,它达到13%,并抛出以下错误: Scanning dependencies of target scene_polyhedron_item [ 13%] Building CXX object CMakeFiles/scene_polyhedron_item.dir/Scene_po

我已经试着让他们工作了一段时间。在安装了库(通过tarball)并通过cmakegui安装了我发现需要的每个依赖项之后,我设法使示例和一些2D演示正常工作

我可以运行三角剖分和多边形演示,但当我尝试制作多面体演示时,它达到13%,并抛出以下错误:

Scanning dependencies of target scene_polyhedron_item
[ 13%] Building CXX object CMakeFiles/scene_polyhedron_item.dir/Scene_polyhedron_item.cpp.o
[ 13%] Building CXX object CMakeFiles/scene_polyhedron_item.dir/scene_polyhedron_item_automoc.cpp.o
Linking CXX shared library libscene_polyhedron_item.so
/usr/bin/ld: /usr/local/lib/x86_64-linux-gnu/libCGAL.a(all_files.cpp.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/x86_64-linux-gnu/libCGAL.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libscene_polyhedron_item.so] Error 1
make[1]: *** [CMakeFiles/scene_polyhedron_item.dir/all] Error 2
make: *** [all] Error 2
我在谷歌上搜索过类似的错误,但我似乎无法将任何答案复制到这篇文章中。我尝试在CMakeLists.txt上添加一个-fPIC标志,但错误仍然存在

使用cmake gui(我可以用它让其他一切正常工作),我注意到只有QGLViewer调试包丢失了。我试图发现它没有用,并且不理解如何制作包的第二个副本以使其成为调试版本,也不理解如何将包的正常版本转换为debuf版本。我也不知道这是否与错误本身有关

另请注意,AABB树示例Seg在启动时出现故障,在cmake/make区域没有错误


现在我不知道该怎么办。我真的需要看看这台计算机上的3D演示,以确保我可以使用这个库

您使用的QGLViewer版本可能有问题。您需要使用QGLViewer QT5版本。这种类型的错误可能是因为您使用的是QGLViewer QT4版本。为了确定你需要说哪一个是你的操作系统,你是如何安装QGLViewer的。我用的是Mint Cinamon“Rafaela”。我做到了:sudo apt-get-install-libqglviewer-devI不知道它是哪个版本。请尝试删除此版本,然后手动安装。在编译libqglviewer时,请确保使用qmake版本QT5。我将尝试此操作并返回给您。如果它试图链接libCGAL.a,则表示它没有编译libCGAL.so。你明确要求了吗?cmake是否有任何迹象表明会发生这种情况?您也可以尝试CGAL的header-only模式来解决这个问题。