看qemu的代码,发现一个不熟悉的函数g_str_hash,在qemu里面怎么搜,都没有搜到。当时还感觉真实奇怪!怎么会没有?
后来发现这个函数可能是一个库函数,但是从本人的认知世界里,从来没见过这个函数,也就是遇到了从未使用过的函数库。
后来从网上找到这个函数属于glib库;这个库和glibc仅有一字之差。很容易混淆。
https://centos.pkgs.org/7/epel-aarch64/glib-1.2.10-41.el7.aarch64.rpm.html
Redhat8的软件名称是:glib2.x86_64
/usr/share/doc/glib2
This is GLib version 2.56.4. GLib is the low-level core library that forms the basis for projects such as GTK+ and GNOME. It provides data structure handling for C, portability wrappers, and interfaces for such runtime functionality as an event loop, threads, dynamic loading, and an object system.
The official download locations are:
ftp://ftp.gtk.org/pub/glib
http://download.gnome.org/sources/glib
The official web site is:
http://www.gtk.org/
Information about mailing lists can be found at
http://www.gtk.org/mailing-lists.php
To subscribe, send mail to gtk-list-request@gnome.org
with the subject “subscribe”.
总结起来,就是如果项目里遇到找不到定义的函数,这个函数可能就是另一个库里的函数。