/usr/bin/ld:找不到 -lvtkproj4

/usr/bin/ld:找不到 -lvtkproj4

我正在尝试编译一些提供的代码我在网上找到了执行 make 的方法。但是当我这样做时,它返回“/usr/bin/ld:找不到 -lvtkproj4”

-ThinkPad-X200:~/PCL/visualRangeExample/build$ make
[ 50%] Linking CXX executable range_image_visualization
/usr/bin/ld: cannot find -lvtkproj4
collect2: error: ld returned 1 exit status
CMakeFiles/range_image_visualization.dir/build.make:364: recipe for target 'range_image_visualization' failed
make[2]: *** [range_image_visualization] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/range_image_visualization.dir/all' failed
make[1]: *** [CMakeFiles/range_image_visualization.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

为了摆脱这个错误,我尝试安装 vtkproj4 和 vtkproj4-dev,但这些包似乎不存在(并且它们的变体也不存在)。

我正在观看视频教程,这正是我陷入困境的时刻

我还能做什么来解决这个问题?

谢谢

编辑:已经有一个错误报告 https://bugs.launchpad.net/ubuntu/+source/vtk6/+bug/1573234

但这并没有帮助我,因为他们说这个错误将在 ubuntu >= 16.10 中修复,而我使用的是 16.04

这是 cmake 生成的 Makefile

# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.5

# Default target executed when no arguments are given to make.
default_target: all

.PHONY : default_target

# Allow only one "make -f Makefile2" at a time, but pass parallelism.
.NOTPARALLEL:


#=============================================================================
# Special targets provided by cmake.

# Disable implicit rules so canonical targets will work.
.SUFFIXES:


# Remove some rules from gmake that .SUFFIXES does not remove.
SUFFIXES =

.SUFFIXES: .hpux_make_needs_suffix_list


# Suppress display of executed commands.
$(VERBOSE).SILENT:


# A target that is always out of date.
cmake_force:

.PHONY : cmake_force

#=============================================================================
# Set environment variables for the build.

# The shell in which to execute make rules.
SHELL = /bin/sh

# The CMake executable.
CMAKE_COMMAND = /usr/bin/cmake

# The command to remove a file.
RM = /usr/bin/cmake -E remove -f

# Escaping for special characters.
EQUALS = =

# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /home/yalishanda/PCL/visualRangeExample

# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /home/yalishanda/PCL/visualRangeExample/build

#=============================================================================
# Targets provided globally by CMake.

# Special rule for the target edit_cache
edit_cache:
    @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..."
    /usr/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available.
.PHONY : edit_cache

# Special rule for the target edit_cache
edit_cache/fast: edit_cache

.PHONY : edit_cache/fast

# Special rule for the target rebuild_cache
rebuild_cache:
    @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
    /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : rebuild_cache

# Special rule for the target rebuild_cache
rebuild_cache/fast: rebuild_cache

.PHONY : rebuild_cache/fast

# The main all target
all: cmake_check_build_system
    $(CMAKE_COMMAND) -E cmake_progress_start /home/yalishanda/PCL/visualRangeExample/build/CMakeFiles /home/yalishanda/PCL/visualRangeExample/build/CMakeFiles/progress.marks
    $(MAKE) -f CMakeFiles/Makefile2 all
    $(CMAKE_COMMAND) -E cmake_progress_start /home/yalishanda/PCL/visualRangeExample/build/CMakeFiles 0
.PHONY : all

# The main clean target
clean:
    $(MAKE) -f CMakeFiles/Makefile2 clean
.PHONY : clean

# The main clean target
clean/fast: clean

.PHONY : clean/fast

# Prepare targets for installation.
preinstall: all
    $(MAKE) -f CMakeFiles/Makefile2 preinstall
.PHONY : preinstall

# Prepare targets for installation.
preinstall/fast:
    $(MAKE) -f CMakeFiles/Makefile2 preinstall
.PHONY : preinstall/fast

# clear depends
depend:
    $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
.PHONY : depend

#=============================================================================
# Target rules for targets named range_image_visualization

# Build rule for target.
range_image_visualization: cmake_check_build_system
    $(MAKE) -f CMakeFiles/Makefile2 range_image_visualization
.PHONY : range_image_visualization

# fast build rule for target.
range_image_visualization/fast:
    $(MAKE) -f CMakeFiles/range_image_visualization.dir/build.make CMakeFiles/range_image_visualization.dir/build
.PHONY : range_image_visualization/fast

range_image_visualization.o: range_image_visualization.cpp.o

.PHONY : range_image_visualization.o

# target to build an object file
range_image_visualization.cpp.o:
    $(MAKE) -f CMakeFiles/range_image_visualization.dir/build.make CMakeFiles/range_image_visualization.dir/range_image_visualization.cpp.o
.PHONY : range_image_visualization.cpp.o

range_image_visualization.i: range_image_visualization.cpp.i

.PHONY : range_image_visualization.i

# target to preprocess a source file
range_image_visualization.cpp.i:
    $(MAKE) -f CMakeFiles/range_image_visualization.dir/build.make CMakeFiles/range_image_visualization.dir/range_image_visualization.cpp.i
.PHONY : range_image_visualization.cpp.i

range_image_visualization.s: range_image_visualization.cpp.s

.PHONY : range_image_visualization.s

# target to generate assembly for a file
range_image_visualization.cpp.s:
    $(MAKE) -f CMakeFiles/range_image_visualization.dir/build.make CMakeFiles/range_image_visualization.dir/range_image_visualization.cpp.s
.PHONY : range_image_visualization.cpp.s

# Help Target
help:
    @echo "The following are some of the valid targets for this Makefile:"
    @echo "... all (the default if no target is provided)"
    @echo "... clean"
    @echo "... depend"
    @echo "... edit_cache"
    @echo "... range_image_visualization"
    @echo "... rebuild_cache"
    @echo "... range_image_visualization.o"
    @echo "... range_image_visualization.i"
    @echo "... range_image_visualization.s"
.PHONY : help



#=============================================================================
# Special targets to cleanup operation of make.

# Special rule to run CMake to check the build system integrity.
# No rule that depends on this can have commands that come from listfiles
# because they might be regenerated.
cmake_check_build_system:
    $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
.PHONY : cmake_check_build_system

编辑2:

我尝试安装 libvtk,结果如下:

yalishanda@yalishanda-ThinkPad-X200:~/PCL/visualRangeExample/build$ sudo apt install libvtk
[sudo] password for yalishanda: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package libvtk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  libvtk5.10:i386 libvtk5.10

E: Package 'libvtk' has no installation candidate


sudo apt install libvtk5.10

Reading package lists... Done
Building dependency tree       
Reading state information... Done
libvtk5.10 is already the newest version (5.10.1+dfsg-2.1build1).
libvtk5.10 set to manually installed.
The following packages were automatically installed and are no longer required:
  gimp-data gimp-help-common gimp-help-en libamd2.4.1 libbabl-0.1-0 libbtf1.2.1 libcamd2.4.1 libccolamd2.9.1 libcsparse3.1.4 libcxsparse3.1.4
  libgimp2.0 libklu1.3.3 libldl2.2.1 linux-headers-4.8.0-36 linux-headers-4.8.0-36-generic linux-image-4.8.0-36-generic
  linux-image-extra-4.8.0-36-generic snap-confine
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

相关内容