No rule to make target '/usr/lib/x86_64-linux-gnu/libGL.so

Ogre at compile time make install emergence of this issue, here I found my libGL.so pointed libGL.so.1.0.0, this is how it goes?

  1. Search libGL.so file path: for example, in the path of this machine is: /usr/lib/libGL.so

  2. Establish symlink: sudo ln -s /usr/lib/libGL.so.1 /usr/lib/x86_64-linux-gnu/libGL.so (the reason is linked to libGL.so.1 instead libGL.so may be in order to facilitate the distinguish)

  3. If an error occurs: ln: failed to create symbolic link '/usr/lib/x86_64-linux-gnu/libGL.so': File exists

    Delete an existing link: sudo rm /usr/lib/x86_64-linux-gnu/libGL.so

  4. Repeat Step 2 build symlink

? ? Why use dynamic link library?

- "Bird Brother private kitchens" mentioned: a dynamic library at compile time, there is only one place in the program "points" (Pointer) only, that is, dynamic content library has not been integrated into executable file, but when the executable file you want to use the library when the program will read the library to use. Because the executable file only has a pointer to the dynamic library where it does not contain content library, so it's a little smaller files. The following excerpt from APUE:

? ? How dynamic library is loaded into the cache it?

- 1. First, we must be /etc/ld.so.confinside the folder you want to write read into the cache directory among the dynamic library is located, note the directory instead of a file.

2. Next, using ldconfig executable file /etc/ld.so.conf.ddata is read into the cache;

3. Data will also record a copy in /etc/ld.so.cachethis document them.

Tips:可以使用ldconfig -p指令查看函数库内容(ld.so.cache)

?? 硬连接与软连接

当我们需要在不同的目录,用到相同的文件时,我们不需要在每一个需要的目录下都放一个必须相同的文件,我们只要在某个固定的目录,放上该文件,然后在 其它的目录下用ln命令链接(link)它就可以,不必重复的占用磁盘空间。

为解决文件的共享使用,Linux 系统引入了两种链接:硬链接 (hard link) 与软链接(又称符号链接,即 soft link 或 symbolic link)。若一个 inode 号对应多个文件名,则称这些文件为硬链接。换言之,硬链接就是同一个文件使用了多个别名。

由于硬链接是有着相同 inode 号仅文件名不同的文件,因此硬链接存在以下几点特性:

  • 文件有相同的 inode 及 data block;
  • 只能对已存在的文件进行创建;
  • 不能交叉文件系统进行硬链接的创建;
  • 不能对目录进行创建,只可对文件创建;
  • 删除一个硬链接文件并不影响其他有相同 inode 号的文件。

软链接与硬链接不同,若文件用户数据块中存放的内容是另一文件的路径名的指向,则该文件就是软连接。软链接就是一个普通文件,只是数据块内容有点特殊。软链接有着自己的 inode 号以及用户数据块(见下图)。因此软链接的创建与使用没有类似硬链接的诸多限制:

  • 软链接有自己的文件属性及权限等;
  • 可对不存在的文件或目录创建软链接;
  • 软链接可交叉文件系统;
  • 软链接可对文件或目录创建;
  • 创建软链接时,链接计数 i_nlink 不会增加;
  • 删除软链接并不影响被指向的文件,但若被指向的原文件被删除,则相关软连接被称为死链接(即 dangling link,若被指向路径文件被重新创建,死链接可恢复为正常的软链接)。

Guess you like

Origin www.cnblogs.com/acewzj/p/11517538.html
Recommended