编译ORB_SLAM 3时报Perhaps you should add the directory containing `roscpp.pc’
[rosbuild] Cached build flags older than manifests; calling rospack to get flags
Failed to invoke /opt/ros/melodic/bin/rospack cflags-only-I;--deps-only ORB_SLAM3
Package roscpp was not found in the pkg-config search path.
Perhaps you should add the directory containing `roscpp.pc'
to the PKG_CONFIG_PATH environment variable
No package 'roscpp' found
[rospack] Error: python function 'rosdep2.rospack.call_pkg_config' could not call 'pkg-config --cflags-only-I roscpp' without errors
很菜的错,查了半天没查到,之后想到看下pkg-config 的用法,是怎么查询数据的
原来要设置~/.bashrc 里,添加下 PKG_CONFIG_PATH 地址就可以 了
gedit ~/.badhrc
# 在最后添加
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/ros/melodic/lib/pkgconfig
设置好,再执行
source ~/.bashrc