我在 Ubuntu 15.10 上。我安装了软件包libboost-program-options1.58-dev
,libboost-all-dev
但是库本身显然不存在:
$ sudo find / -name libboost_program_options
仅存在的 boost 库包括:
$ l /usr/lib/x86_64-linux-gnu/ | grep libboost
-rw-r--r-- 1 root root 67K Oct 14 15:53 libboost_date_time.so.1.58.0
-rw-r--r-- 1 root root 95K Oct 14 15:53 libboost_filesystem.so.1.58.0
-rw-r--r-- 1 root root 95K Oct 14 15:53 libboost_iostreams.so.1.58.0
-rw-r--r-- 1 root root 15K Oct 14 15:53 libboost_system.so.1.58.0
我在使用某些程序时遇到以下错误:
$ vera++
vera++: error while loading shared libraries: libboost_program_options.so.1.58.0: cannot open shared object file: No such file or directory
FAIL
这些包裹出了什么问题?
更新:
$ apt-cache policy libboost1.58-dev
libboost1.58-dev:
Installed: 1.58.0+dfsg-3.1ubuntu1
Candidate: 1.58.0+dfsg-3.1ubuntu1
Version table:
*** 1.58.0+dfsg-3.1ubuntu1 0
500 http://us.archive.ubuntu.com/ubuntu/ wily/main amd64 Packages
100 /var/lib/dpkg/status
$ sudo apt-get install libboost-program-options-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libboost-program-options-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 13 not upgraded.
$ dpkg -L libboost-program-options1.58-dev [14:12:23]
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/libboost-program-options1.58-dev
/usr/share/doc/libboost-program-options1.58-dev/copyright
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libboost_program_options.a
/usr/share/doc/libboost-program-options1.58-dev/changelog.Debian.gz
/usr/lib/x86_64-linux-gnu/libboost_program_options.so
$ cat /usr/lib/x86_64-linux-gnu/libboost_program_options.so [14:13:01]
cat: /usr/lib/x86_64-linux-gnu/libboost_program_options.so: No such file or directory
答案1
您需要安装 libboost-program-options-dev 包:
sudo apt-get install libboost-program-options-dev
安装完成后,您可以运行 find 命令来找到它:
在 16.04 上,我在 /usr/lib/x86_64-linux-gnu/libboost_program_options.so.1.58.0 找到它