gpt4 book ai didi

c++ - 无法链接到 vtk 6.3/usr/bin/ld : cannot find -lvtkCommon

转载 作者:行者123 更新时间:2023-11-28 02:06:12 27 4
gpt4 key购买 nike

我从源代码安装了 vtk 6.3,我正在尝试使用以下 cmake 编译我的项目:

cmake_minimum_required (VERSION 2.6 FATAL_ERROR)

project (paintsquad)
find_package (Qt5 REQUIRED COMPONENTS Widgets Core)
find_package (VTK 6.3 REQUIRED)
find_package (PCL 1.8.0 REQUIRED)

include_directories (/usr/local/lib)
INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR})
include_directories (${PCL_INCLUDE_DIRS})
link_directories (${PCL_LIBRARY_DIRS})
add_definitions (${PCL_DEFINITIONS})

...

QT5_WRAP_CPP (project_HEADERS_MOC ${project_HEADERS})
QT5_WRAP_UI (project_FORMS_HEADERS ${project_FORMS})

ADD_DEFINITIONS (${QT_DEFINITIONS})

ADD_EXECUTABLE (pcl_visualizer ${project_SOURCES}
${project_FORMS_HEADERS}
${project_HEADERS_MOC}
${project_hpp_files})

TARGET_LINK_LIBRARIES (pcl_visualizer ${PCL_LIBRARIES})
qt5_use_modules (pcl_visualizer Widgets)

但是我收到了这些链接器错误:

/usr/bin/ld: cannot find -lvtkCommon
/usr/bin/ld: cannot find -lvtkFiltering
/usr/bin/ld: cannot find -lvtkImaging
/usr/bin/ld: cannot find -lvtkGraphics
/usr/bin/ld: cannot find -lvtkGenericFiltering
/usr/bin/ld: cannot find -lvtkIO
/usr/bin/ld: cannot find -lvtkRendering
/usr/bin/ld: cannot find -lvtkVolumeRendering
/usr/bin/ld: cannot find -lvtkHybrid
/usr/bin/ld: cannot find -lvtkWidgets
/usr/bin/ld: cannot find -lvtkInfovis
/usr/bin/ld: cannot find -lvtkGeovis
/usr/bin/ld: cannot find -lvtkViews
/usr/bin/ld: cannot find -lvtkCharts
collect2: error: ld returned 1 exit status

我之前已经从源代码安装了 vtk 5.8,所以现在我必须安装。我正在使用 ubuntu 16。

最佳答案

问题是我以前用 vtk 5.8 版编译过 pcl,然后尝试使用我后来安装的 vtk 6.3 版。

所以我通过先删除我的 vtk 5.8 然后用 vtk 版本 6.3 重新编译 pcl 来解决这个问题。

关于c++ - 无法链接到 vtk 6.3/usr/bin/ld : cannot find -lvtkCommon,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37312137/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com