我正在使用库 SFML 编写程序,它需要 libX11。我最近刚从旧版本升级到 ubuntu 11.04,从那以后我就无法编译我的程序。我收到以下错误:
make[3]: *** No rule to make target `/usr/lib/libX11.so', needed by `lib/libsfml-window.so.2.0.0'. Stop.
我想也许当我升级 Ubuntu 时由于某种原因卸载了该软件包,但根据 Synaptic 的说法,我有 libX11-dev(我只是假设这就是我应该寻找的,但我可能错了) .
编辑:
运行 apt-get install libx11-dev
得到以下输出:
sudo apt-get install libx11-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libx11-dev is already the newest version.
g++-4.4 libstdc++6-4.4-dev
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 32 not upgraded.
并使用 --reinstall 标志运行会得到这个:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
g++-4.4 libstdc++6-4.4-dev
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 32 not upgraded.
Need to get 0 B/3,104 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 279595 files and directories currently installed.)
Preparing to replace libx11-dev 2:1.4.2-1ubuntu3 (using .../libx11-dev_2%3a1.4.2-1ubuntu3_i386.deb) ...
Unpacking replacement libx11-dev ...
Processing triggers for man-db ...
Setting up libx11-dev (2:1.4.2-1ubuntu3) ...
最佳答案
事实证明,我只需要对所有内容执行简单的 make clean
即可。我仍然不清楚更新之间发生了什么,但是当我从头开始重建项目时,一切都可以编译和工作。
关于c++ - 没有规则使 target/usr/lib/libX11.so,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6326032/