zrób problem: brak reguły, aby cel /usr/lib/x86_64-linux-gnu/libpcl_common.so

8

Wykonuję ten samouczek, aby uruchomić jeden z przykładów dostarczonych przez PCL (biblioteka chmury punktów): https://www.youtube.com/watch?v=CXK95Hi4M7I

Ale podczas wykonywania polecenia make ( https://youtu.be/CXK95Hi4M7I?t=243 ) otrzymuję następujące dane wyjściowe:

yalishanda@yalishanda-thinkpad-x200:~/PCL/visualRangeExample/build$ make
make[2]: *** No rule to make target '/usr/lib/x86_64-linux-gnu/libpcl_common.so', needed by 'range_image_visualization'.  Stop.
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

Czy ktoś mógłby mi powiedzieć, na czym polega problem i jak go rozwiązać?

Dziękuję Ci

EDYTOWAĆ:

Plik Makefile wygenerowany przez cmake:

# 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

plik CMakeLists.txt:

cmake_minimum_required(VERSION 2.6 FATAL_ERROR)

project(range_image_visualization)

find_package(PCL 1.3 REQUIRED)

include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})

add_executable (range_image_visualization range_image_visualization.cpp)
target_link_libraries (range_image_visualization ${PCL_LIBRARIES})
LandonZeKepitelOfGreytBritn
źródło
Czy masz libproj-devzainstalowany? Zainstaluj i spróbuj ponownie.
Seth
@Seth Tak, jest już zainstalowany. Zaktualizowałem swój post za pomocą Makefile
LandonZeKepitelOfGreytBritn

Odpowiedzi:

12

Błąd:

make [2]: *** Brak reguły, aby cel „/usr/lib/x86_64-linux-gnu/libpcl_common.so” był potrzebny przez „range_image_visualization”. Zatrzymać.

oznacza, że ​​make nie może znaleźć pliku /usr/lib/x86_64-linux-gnu/libpcl_common.sopotrzebnego do ukończenia kompilacji.

Najpierw sprawdź, czy plik istnieje:

$ stat /usr/lib/x86_64-linux-gnu/libpcl_common.so  
stat: cannot stat '/usr/lib/x86_64-linux-gnu/libpcl_common.so': No such file or directory  

Ok, więc musimy go zainstalować. Najłatwiejszym sposobem libpcl_common.soustalenia , co zapewnia pakiet, jest użycie narzędzia o nazwie apt-file. Zainstaluj i skonfiguruj:

sudo apt-get install apt-file
apt-file update

Po zakończeniu możesz uruchomić:

$ apt-file search /usr/lib/x86_64-linux-gnu/libpcl_common.so  
libpcl-common1.8: /usr/lib/x86_64-linux-gnu/libpcl_common.so.1.8
libpcl-common1.8: /usr/lib/x86_64-linux-gnu/libpcl_common.so.1.8.0
libpcl-dev: /usr/lib/x86_64-linux-gnu/libpcl_common.so

I proszę bardzo! Zainstaluj libpcl-devi powinieneś być złoty.

Warto również zauważyć, że zwykle w katalogu źródłowym powinien znajdować się plik README z listą zależności, które należy zainstalować, co powinno pomóc w usunięciu części zgadywania i zaoszczędzić trochę czasu.

Seth
źródło
btw, zwykle szukam pakietów przy użyciu apt-cache. Innymi słowy wypróbowałem tutaj „sudo apt-cache pkgnames libpcl”, co daje znacznie więcej opcji. Ale po prostu nie mam pojęcia, który z nich zainstalować. Czy lepiej zawsze używać alternatywy, np. Apt-file? Czym się różnią?
LandonZeKepitelOfGreytBritn
1
@trilolil apt-cache searchprzeszukuje tylko nazwę pakietu i krótki opis. apt-file searchszuka w pakietach, który zawiera szukany plik.
Seth