20161202(day-10)
make vtk7.1相关工程错误:
/usr/bin/ld: cannot find -lvtkRenderingOpenGL2
/usr/bin/ld: cannot find -lvtkglew
/usr/bin/ld: cannot find -lvtkRenderingVolumeOpenGL2
/usr/bin/ld: cannot find -lvtkDomainsChemistryOpenGL2
/usr/bin/ld: cannot find -lvtkRenderingGL2PSOpenGL2
/usr/bin/ld: cannot find -lvtkRenderingContextOpenGL2
解决方法:修改CmakeLists.txt
-find_package(VTK REQUIRED)
+find_package(VTK COMPONENTS vtkCommonCore vtkRenderingOpenGL vtkRenderingVolumeOpenGL
具体package model根据工程需求
分析,由于我的vtk7.1编译使用的是OpenGL而不是OpenGL2
cmake 与gdb结合调试程序
gdb带参数调试程序:如果直接
gdb a.out arg1 arg2 ...
则可能遇到问题
Excess command line arguments ignored.
需要:
$gdb a.out
(gdb) run arg1 arg2
or
r arg1 arg2
调试vtk相关程序问题:
/usr/local/include/vtk-7.1/vtkSmartPointer.h:137: undefined reference to `vtkPLYReader::New()'
解决方法:(缺少相关依赖库)
cmake中添加
find_package(VTK COMPONENTS vtkIOPLY)