0

我尝试学习如何使用 realityGrid,所以我使用 cmake 来构建一些示例。完成使用 ccmake 命令后,我尝试使用 make 命令。但我不断地得到错误:

/usr/bin/ld: cannot find -lvtkCommon
/usr/bin/ld: cannot find -lvtkFiltering
/usr/bin/ld: cannot find -lvtkGraphics
/usr/bin/ld: cannot find -lvtkImaging
/usr/bin/ld: cannot find -lvtkIO
/usr/bin/ld: cannot find -lvtkRendering

我在 /usr/lib/vtk-5.10 中找到了 libvtkCommon.a。我应该怎么办?提前谢谢。

4

2 回答 2

0

you should install the package containing the "vtk" libraries so ld can find them.

if you installed them manually you need to add the path at which those files are located to the library path configuration.

http://blog.andrewbeacock.com/2007/10/how-to-add-shared-libraries-to-linuxs.html

于 2013-04-15T10:00:31.280 回答
0

您需要告诉 CMake 您需要 VTK 模块。我没有太多使用 CMake,但我相信你需要的行是这样的:

find_package(VTK REQUIRED NO_MODULE)
include(${VTK_USE_FILE})

如果这不起作用,您可能会退回到这样的事情:

set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /usr/lib/vtk-5.10)

最后一行的坏处是它不能很好地移植到版本略有不同的其他环境。

于 2013-04-15T10:06:45.923 回答