我在 Centos.EL7 上编译 meshlab-2016.12 时遇到问题。
我得到了一些方法。
将 QT 更新为 Qt-5.9.1,因为 Centos 上的最新版本是 Qt 版本 5.6.1 - 我之前安装过
sudo yum install qt5-qtbase
sudo yum install qt5-qtx11extras
sudo yum install qt5-qtbase-devel
但是,meshlab 至少需要 Qt5.7
然后设置这些环境。变量
setenv QTDIR /usr/local/Qt-5.9.1
setenv QTINC /usr/local/Qt-5.9.1/include
setenv QTLIB /usr/local/Qt-5.9.1/lib
setenv PATH /usr/local/Qt-5.9.1/bin:$PATH
setenv PATH /usr/local/bin:/usr/local/Qt-5.9.1/bin:$PATH
然后按照测试机器上的说明安装到 /opt/TESTING
将 vcglib 安装到 /opt/TESTING
将 meshlab-2016.12 下载到 /opt/TESTING 并在那里解压
跑了以下
qmake-项目
(这会选择正确版本的 QT)
qmake src/external/external.pro
(制作外部库 - 包括 jhead-2.95
gmake
gmake install
(制作外部库 - 包括 jhead-2.95 )
qmake src/meshlab_mini.pro
(使用最少的插件集构建 meshlab )
这就是失败的地方,如下所示;
../../vcglib/vcg/complex/algorithms/clean.h:1789:0:
warning: ignoring #pragma omp parallel [-Wunknown-pragmas]
pragma omp parallel for schedule(dynamic, 10)
g++ -Wl,-O1 -Wl,-z,origin -Wl,-rpath,\$ORIGIN/../distrib -Wl,-rpath,
/usr/local/Qt-5.9.1/lib -o ../distrib/meshlab main.o mainwindow_Init.o
mainwindow_RunTime.o glarea.o multiViewer_Container.o plugindialog.o
customDialog.o filterScriptDialog.o saveSnapshotDialog.o layerDialog.o
savemaskexporter.o changetexturename.o stdpardialog.o ml_std_par_dialog.o
xmlstdpardialog.o additionalgui.o xmlgeneratorgui.o ml_render_gui.o
ml_rendering_actions.o ml_default_decorators.o ml_selection_buffers.o
trackball.o trackmode.o coordinateframe.o glarea_setting.o filterthread.o
qrc_meshlab.o moc_interfaces.o moc_mainwindow.o moc_glarea.o
moc_multiViewer_Container.o moc_plugindialog.o moc_customDialog.o
moc_filterScriptDialog.o moc_saveSnapshotDialog.o moc_savemaskexporter.o
moc_changetexturename.o moc_layerDialog.o moc_stdpardialog.o
moc_ml_std_par_dialog.o moc_xmlstdpardialog.o moc_additionalgui.o
moc_xmlgeneratorgui.o moc_ml_render_gui.o moc_ml_rendering_actions.o
moc_filterthread.o -L../external/lib/linux-g++ -ljhead -L../distrib
-lcommon -lGLU -L/usr/local/Qt-5.9.1/lib -lQt5OpenGL -lQt5Widgets -lQt5Gui
-lQt5Xml -lQt5XmlPatterns -lQt5Network -lQt5Script -lQt5Core -lGL -lpthread
/bin/ld: cannot find -ljhead
collect2: error: ld returned 1 exit status
gmake[1]: *** [../distrib/meshlab] Error 1
gmake[1]: Leaving directory `/opt/TESTING/meshlab-2016.12/meshlab'
gmake: *** [sub-meshlab-make_first-ordered] Error 2
所以说ld找不到ljhead。编译的其他部分似乎确实可以找到它,例如
-I../src/external/glew-1.7.0/include -I../src/external/jhead-2.95
看着ld
/bin/ld -V
GNU ld version 2.25.1-22.base.el7
Supported emulations:
elf_x86_64
elf32_x86_64
elf_i386
i386linux
elf_l1om
elf_k1om
和 /
usr/bin/ld -V
GNU ld version 2.25.1-22.base.el7
Supported emulations:
elf_x86_64
elf32_x86_64
elf_i386
i386linux
elf_l1om
elf_k1om
在这一点上,任何建议都会很有用。希望我只是错过了一些东西
更新:尝试了下面 William Brown 的解决方法,取得了一些进展。后来失败了
gmake[1]: Leaving directory `/opt/src/meshlab/meshlabplugins/filter_layer'
cd meshlabplugins/filter_measure/ && ( test -e Makefile || /opt/bin/Qt5.7.1/5.7/gcc_64/bin/qmake
/opt/src/meshlab/src/meshlabplugins/filter_measure/filter_measure.pro -o Makefile ) && gmake -f Makefile
gmake[1]: Entering directory `/opt/src/meshlab/meshlabplugins/filter_measure'
gmake[1]: *** No rule to make target `filter_measure.xml', needed by `../../distrib/plugins/libfilter_measure.so'. Stop.
gmake[1]: Leaving directory `/opt/src/meshlab/meshlabplugins/filter_measure'
gmake: *** [sub-meshlabplugins-filter_measure-make_first-ordered] Error 2