I personally install glib in centOS7, test successfully

Source: Internet
Author: User

[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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.