我正在使用
从源代码安装Aruco 3.0.10version="3.0.10"
pkg="aruco-${version}.zip"
url="https://netix.dl.sourceforge.net/project/aruco/3.0.0/${pkg}"
cd `mktemp -d`
wget -O $pkg $url
unzip $pkg
cd aruco-${version}
mkdir build && cd build
cmake ..
make -j
sudo make install
给了我/usr/local/lib/pkgconfig/aruco.pc
:
# pkg-config file for the library
prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: aruco
Description: ARUCO Library for marker detection
Version: 3.0.10
Requires: opencv >= 2.1.0
Conflicts:
Libs: -L${libdir} -laruco
Cflags: -I${includedir}/aruco -I${includedir}
但是,pkg-config aruco --libs
打印
-L/tmp/tmp.gNQGFAaTtz/aruco-3.0.10/build -laruco /usr/lib/x86_64-linux-gnu/libopencv_calib3d.so -lopencv_calib3d /usr/lib/x86_64-linux-gnu/libopencv_contrib.so -lopencv_contrib /usr/lib/x86_64-linux-gnu/libopencv_core.so -lopencv_core /usr/lib/x86_64-linux-gnu/libopencv_features2d.so -lopencv_features2d /usr/lib/x86_64-linux-gnu/libopencv_flann.so -lopencv_flann /usr/lib/x86_64-linux-gnu/libopencv_gpu.so -lopencv_gpu /usr/lib/x86_64-linux-gnu/libopencv_highgui.so -lopencv_highgui /usr/lib/x86_64-linux-gnu/libopencv_imgproc.so -lopencv_imgproc /usr/lib/x86_64-linux-gnu/libopencv_legacy.so -lopencv_legacy /usr/lib/x86_64-linux-gnu/libopencv_ml.so -lopencv_ml /usr/lib/x86_64-linux-gnu/libopencv_objdetect.so -lopencv_objdetect /usr/lib/x86_64-linux-gnu/libopencv_ocl.so -lopencv_ocl /usr/lib/x86_64-linux-gnu/libopencv_photo.so -lopencv_photo /usr/lib/x86_64-linux-gnu/libopencv_stitching.so -lopencv_stitching /usr/lib/x86_64-linux-gnu/libopencv_superres.so -lopencv_superres /usr/lib/x86_64-linux-gnu/libopencv_ts.so -lopencv_ts /usr/lib/x86_64-linux-gnu/libopencv_video.so -lopencv_video /usr/lib/x86_64-linux-gnu/libopencv_videostab.so -lopencv_videostab
所以它似乎没有使用prefix=/usr/local
,而是使用构建目录。由于这是一个临时文件夹,因此不会长时间使用。我该如何解决这个问题?
答案 0 :(得分:0)
使用pkg-config aruco --debug
我发现pkg-config是
首选卸载的'aruco'软件包
使用/usr/local/lib/pkgconfig/aruco-uninstalled.pc
:
libdir=/tmp/tmp.37YkQGEdY8/aruco-3.0.10/build
includedir=/tmp/tmp.37YkQGEdY8/aruco-3.0.10/src
Name: aruco
Description: ArUco: a minimal library for Augmented Reality applications based on OpenCv, uninstalled Version.
Version: 3.0.10
Requires: opencv >= 2.1.0
Libs: -L${libdir} -laruco
Cflags: -I${includedir}
删除/usr/local/lib/pkgconfig/aruco-uninstalled.pc
可以解决问题
现在,pkg-config aruco --libs
给出了
-L/usr/local/lib -laruco /usr/lib/x86_64-linux-gnu/libopencv_calib3d.so -lopencv_calib3d /usr/lib/x86_64-linux-gnu/libopencv_contrib.so -lopencv_contrib /usr/lib/x86_64-linux-gnu/libopencv_core.so -lopencv_core /usr/lib/x86_64-linux-gnu/libopencv_features2d.so -lopencv_features2d /usr/lib/x86_64-linux-gnu/libopencv_flann.so -lopencv_flann /usr/lib/x86_64-linux-gnu/libopencv_gpu.so -lopencv_gpu /usr/lib/x86_64-linux-gnu/libopencv_highgui.so -lopencv_highgui /usr/lib/x86_64-linux-gnu/libopencv_imgproc.so -lopencv_imgproc /usr/lib/x86_64-linux-gnu/libopencv_legacy.so -lopencv_legacy /usr/lib/x86_64-linux-gnu/libopencv_ml.so -lopencv_ml /usr/lib/x86_64-linux-gnu/libopencv_objdetect.so -lopencv_objdetect /usr/lib/x86_64-linux-gnu/libopencv_ocl.so -lopencv_ocl /usr/lib/x86_64-linux-gnu/libopencv_photo.so -lopencv_photo /usr/lib/x86_64-linux-gnu/libopencv_stitching.so -lopencv_stitching /usr/lib/x86_64-linux-gnu/libopencv_superres.so -lopencv_superres /usr/lib/x86_64-linux-gnu/libopencv_ts.so -lopencv_ts /usr/lib/x86_64-linux-gnu/libopencv_video.so -lopencv_video /usr/lib/x86_64-linux-gnu/libopencv_videostab.so -lopencv_videostab