[Root@vm_244_82_centos ambition_bin]# wget http://ftp.acc.umu.se/pub/GNOME/sources/glib/2.45/glib-2.45.2.tar.xz
The version I'm using
TAR-XVF GLIB/2.45/GLIB-2.45.2.TAR.XZ
And then the Setup trilogy:
./configure
Make
Make install
Test code
#include <stdio.h>
#include "glib.h"
int main (int agrc, char **argv)
{
g_printf (" Hello world!\n ");
return 0;
}
Don't say anything first, GCC compile a problem
The header file cannot be found.
Download libffi-3.2.1.tar.gz Library Download Address:
http://download.csdn.net/detail/tjssehaige/8215719
And then I don't have to say it. Installation Trilogy
After the installation and then compile, incredibly also said I do not have a header file. It turns out that we used the header file with the <> the header files are located in the header file directory where the environment variable is set, and the directory is/usr/include directory so CP is fine:
Cp-r/usr/local/include/glib-2.0/*/usr/include/
And then, in compiling,
The old rules in CP:
cp/usr/local/lib/glib-2.0/include/glibconfig.h/usr/include/
At compile-time appears:
The original is compiled without the generation of storage
[Root@vm_244_82_centos ambition_bin]# gcc test.c-lglib-2.0
Install glib!