Glib in Windows)

Source: Internet
Author: User

Glib is a basic library in Linux and encapsulates some C interfaces. Of course, it is also cross-platform.
However, it takes a long time to run on Windows.
First download the dynamic library from the official website
Http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.12/glib-2.12.11.zip
Http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.12/glib-dev-2.12.11.zip
You can download the compiled windows DLL on the GNU official website. glib-2.12.11.zip only contains the dynamic library and does not have the Lib library. Therefore, it can only be used during runtime. The glib-dev-2.12.11.zip contains header files and Lib libraries. Merge the items in the previous package into the bin.

Use vs (2005) to create a win32console project. In properties, input the directory c: \ opensource \ glib \ glib-dev-2.12.11 \ include \ glib-2.0 in the additional include directory of C ++
Enter the glib-2.0.lib In the linker input additional dependency
Add library directory in the linker General, enter the directory where the glib-2.0.lib is located
C: \ opensource \ glib \ glib-dev-2.12.11 \ Lib
Finally, copy the libglib-2.0-0.dll under the bin to the testProgram.
Glibconfig. h my solution is to copy this file under c: \ opensource \ glib \ glib-dev-2.12.11 \ Lib \ glib-2.0 \ include to C: \ opensource \ glib \ glib-dev-2.12.11 \ include \ glib-2.0.
Simple TestCode:

 

Code

  # Include  <  Iostream  >  
# Include < Glib. h >
# Include < Glib / Gprs intf. h >

Int Main ( Int Argc, Char * Argv [])
{
Gchar ch [ 128 ];
G_sprintf (CH, " Hello World " );
STD: cout < G_strup (CH) < STD: Endl;
Return 0 ;
}

 

 

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/owe/archive/2007/05/10/1603744.aspx

Related Article

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.