我跑
sudo apt-get install libboost-all-dev
但我在我的/usr/include
目录中没有看到任何可以提升的东西。
0 upgraded, 27 newly installed, 0 to remove and 2 not upgraded.
Need to get 0 B/78.9 kB of archives.
After this operation, 276 kB of additional disk space will be used.
Selecting previously unselected package libboost-dev:amd64.
(Reading database ... 503640 files and directories currently installed.)
Preparing to unpack .../libboost-dev_1.58.0.1ubuntu1_amd64.deb ...
Unpacking libboost-dev:amd64 (1.58.0.1ubuntu1) ...
Selecting previously unselected package libboost-tools-dev.
Preparing to unpack .../libboost-tools-dev_1.58.0.1ubuntu1_amd64.deb ...
Unpacking libboost-tools-dev (1.58.0.1ubuntu1) ...
Selecting previously unselected package libboost-atomic-dev:amd64.
Preparing to unpack .../libboost-atomic-dev_1.58.0.1ubuntu1_amd64.deb ...
Unpacking libboost-atomic-dev:amd64 (1.58.0.1ubuntu1) ...
Selecting previously unselected package libboost-chrono-dev:amd64.
Preparing to unpack .../libboost-chrono-dev_1.58.0.1ubuntu1_amd64.deb ...
Unpacking libboost-chrono-dev:amd64 (1.58.0.1ubuntu1) ...
Selecting previously unselected package libboost-context-dev:amd64.
Preparing to unpack .../libboost-context-dev_1.58.0.1ubuntu1_amd64.deb ...
Unpacking libboost-context-dev:amd64 (1.58.0.1ubuntu1) ...
Selecting previously unselected package libboost-coroutine-dev:amd64.
Preparing to unpack .../libboost-coroutine-dev_1.58.0.1ubuntu1_amd64.deb ...
Unpacking libboost-coroutine-dev:amd64 (1.58.0.1ubuntu1) ...
Selecting previously unselected package libboost-date-time-dev:amd64.
Preparing to unpack .../libboost-date-time-dev_1.58.0.1ubuntu1_amd64.deb ...
Unpacking libboost-date-time-dev:amd64 (1.58.0.1ubuntu1) ...
Selecting previously unselected package libboost-exception-dev:amd64.
Preparing to unpack .../libboost-exception-dev_1.58.0.1ubuntu1_amd64.deb ...
Unpacking libboost-exception-dev:amd64 (1.58.0.1ubuntu1) ...
Selecting previously unselected package libboost-filesystem-dev:amd64.
Preparing to unpack .../libboost-filesystem-dev_1.58.0.1ubuntu1_amd64.deb ...
Unpacking libboost-filesystem-dev:amd64 (1.58.0.1ubuntu1) ...
Selecting previously unselected package libboost-graph-dev:amd64.
Preparing to unpack .../libboost-graph-dev_1.58.0.1ubuntu1_amd64.deb ...
Unpacking libboost-graph-dev:amd64 (1.58.0.1ubuntu1) ...
Selecting previously unselected package libboost-graph-parallel-dev.
Preparing to unpack .../libboost-graph-parallel-dev_1.58.0.1ubuntu1_amd64.deb ...
Unpacking libboost-graph-parallel-dev (1.58.0.1ubuntu1) ...
Selecting previously unselected package libboost-iostreams-dev:amd64.
Preparing to unpack .../libboost-iostreams-dev_1.58.0.1ubuntu1_amd64.deb ...
Unpacking libboost-iostreams-dev:amd64 (1.58.0.1ubuntu1) ...
Selecting previously unselected package libboost-locale-dev:amd64.
Preparing to unpack .../libboost-locale-dev_1.58.0.1ubuntu1_amd64.deb ...
Unpacking libboost-locale-dev:amd64 (1.58.0.1ubuntu1) ...
Selecting previously unselected package libboost-log-dev.
Preparing to unpack .../libboost-log-dev_1.58.0.1ubuntu1_amd64.deb ...
Unpacking libboost-log-dev (1.58.0.1ubuntu1) ...
Selecting previously unselected package libboost-math-dev:amd64.
Preparing to unpack .../libboost-math-dev_1.58.0.1ubuntu1_amd64.deb ...
Unpacking libboost-math-dev:amd64 (1.58.0.1ubuntu1) ...
Selecting previously unselected package libboost-mpi-dev.
Preparing to unpack .../libboost-mpi-dev_1.58.0.1ubuntu1_amd64.deb ...
Unpacking libboost-mpi-dev (1.58.0.1ubuntu1) ...
Selecting previously unselected package libboost-mpi-python-dev.
Preparing to unpack .../libboost-mpi-python-dev_1.58.0.1ubuntu1_amd64.deb ...
Unpacking libboost-mpi-python-dev (1.58.0.1ubuntu1) ...
Selecting previously unselected package libboost-random-dev:amd64.
Preparing to unpack .../libboost-random-dev_1.58.0.1ubuntu1_amd64.deb ...
Unpacking libboost-random-dev:amd64 (1.58.0.1ubuntu1) ...
Selecting previously unselected package libboost-regex-dev:amd64.
Preparing to unpack .../libboost-regex-dev_1.58.0.1ubuntu1_amd64.deb ...
Unpacking libboost-regex-dev:amd64 (1.58.0.1ubuntu1) ...
Selecting previously unselected package libboost-serialization-dev:amd64.
Preparing to unpack .../libboost-serialization-dev_1.58.0.1ubuntu1_amd64.deb ...
Unpacking libboost-serialization-dev:amd64 (1.58.0.1ubuntu1) ...
Selecting previously unselected package libboost-signals-dev:amd64.
Preparing to unpack .../libboost-signals-dev_1.58.0.1ubuntu1_amd64.deb ...
Unpacking libboost-signals-dev:amd64 (1.58.0.1ubuntu1) ...
Selecting previously unselected package libboost-system-dev:amd64.
Preparing to unpack .../libboost-system-dev_1.58.0.1ubuntu1_amd64.deb ...
Unpacking libboost-system-dev:amd64 (1.58.0.1ubuntu1) ...
Selecting previously unselected package libboost-test-dev:amd64.
Preparing to unpack .../libboost-test-dev_1.58.0.1ubuntu1_amd64.deb ...
Unpacking libboost-test-dev:amd64 (1.58.0.1ubuntu1) ...
Selecting previously unselected package libboost-thread-dev:amd64.
Preparing to unpack .../libboost-thread-dev_1.58.0.1ubuntu1_amd64.deb ...
Unpacking libboost-thread-dev:amd64 (1.58.0.1ubuntu1) ...
Selecting previously unselected package libboost-timer-dev:amd64.
Preparing to unpack .../libboost-timer-dev_1.58.0.1ubuntu1_amd64.deb ...
Unpacking libboost-timer-dev:amd64 (1.58.0.1ubuntu1) ...
Selecting previously unselected package libboost-wave-dev:amd64.
Preparing to unpack .../libboost-wave-dev_1.58.0.1ubuntu1_amd64.deb ...
Unpacking libboost-wave-dev:amd64 (1.58.0.1ubuntu1) ...
Selecting previously unselected package libboost-all-dev.
Preparing to unpack .../libboost-all-dev_1.58.0.1ubuntu1_amd64.deb ...
Unpacking libboost-all-dev (1.58.0.1ubuntu1) ...
Setting up libboost-dev:amd64 (1.58.0.1ubuntu1) ...
Setting up libboost-tools-dev (1.58.0.1ubuntu1) ...
Setting up libboost-atomic-dev:amd64 (1.58.0.1ubuntu1) ...
Setting up libboost-chrono-dev:amd64 (1.58.0.1ubuntu1) ...
Setting up libboost-context-dev:amd64 (1.58.0.1ubuntu1) ...
Setting up libboost-coroutine-dev:amd64 (1.58.0.1ubuntu1) ...
Setting up libboost-date-time-dev:amd64 (1.58.0.1ubuntu1) ...
Setting up libboost-exception-dev:amd64 (1.58.0.1ubuntu1) ...
Setting up libboost-filesystem-dev:amd64 (1.58.0.1ubuntu1) ...
Setting up libboost-graph-dev:amd64 (1.58.0.1ubuntu1) ...
Setting up libboost-graph-parallel-dev (1.58.0.1ubuntu1) ...
Setting up libboost-iostreams-dev:amd64 (1.58.0.1ubuntu1) ...
Setting up libboost-locale-dev:amd64 (1.58.0.1ubuntu1) ...
Setting up libboost-log-dev (1.58.0.1ubuntu1) ...
Setting up libboost-math-dev:amd64 (1.58.0.1ubuntu1) ...
Setting up libboost-mpi-dev (1.58.0.1ubuntu1) ...
Setting up libboost-mpi-python-dev (1.58.0.1ubuntu1) ...
Setting up libboost-random-dev:amd64 (1.58.0.1ubuntu1) ...
Setting up libboost-regex-dev:amd64 (1.58.0.1ubuntu1) ...
Setting up libboost-serialization-dev:amd64 (1.58.0.1ubuntu1) ...
Setting up libboost-signals-dev:amd64 (1.58.0.1ubuntu1) ...
Setting up libboost-system-dev:amd64 (1.58.0.1ubuntu1) ...
Setting up libboost-test-dev:amd64 (1.58.0.1ubuntu1) ...
Setting up libboost-thread-dev:amd64 (1.58.0.1ubuntu1) ...
Setting up libboost-timer-dev:amd64 (1.58.0.1ubuntu1) ...
Setting up libboost-wave-dev:amd64 (1.58.0.1ubuntu1) ...
Setting up libboost-all-dev (1.58.0.1ubuntu1) ...
然而 boost 文件夹仍然丢失的。
为什么会发生?
答案1
您的 Boost 库丢失了,因为您无意中没有安装它。我在评论中为您提供的命令是对安装的验证。如果库已正确安装,则输出将只有几行。
输出的第一行是:
0 upgraded, 27 newly installed, 0 to remove and 2 not upgraded.
这表明在处理命令时缺少并安装了 27 个包。
安装/重新安装命令:
$ sudo apt install --reinstall libboost-all-dev
输出:
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B/2,228 B of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 262406 files and directories currently installed.)
Preparing to unpack .../libboost-all-dev_1.58.0.1ubuntu1_amd64.deb ...
Unpacking libboost-all-dev (1.58.0.1ubuntu1) over (1.58.0.1ubuntu1) ...
Setting up libboost-all-dev (1.58.0.1ubuntu1) ...
现在促进正确安装后,重新安装将仅显示 10 行。此命令行将显示 boost 包含目录:
$ ls -ld /usr/include/b*
输出大约有两行:
drwxr-xr-x 103 root root 12288 1 月 16 日 17:01/usr/include/boost -rw-r--r-- 1 root root 1404 11月16日 17:43 /usr/include/byteswap.h