1. download glib Binaries and Dev and extract them to
F:\glib\glib_2.24.0_dll
F:\glib\glib-dev_2.24.0-2_win32
2. open VC 2005 and create a windows console project
project property (alt + f7)
* General -> Additional Include Directories: F:\glib\glib-dev_2.24.0-2_win32\include\glib-2.0
* Linker -> General -> Additional Library Dependencies: "F:\glib\glib-dev_2.24.0-2_win32\lib"
* Linker -> Input -> Additional Dependencies: glib-2.0.lib
* copy from F:\glib\glib-dev_2.24.0-2_win32\lib\glib-2.0\include\glibconfig.h to F:\glib\glib-dev_2.24.0-2_win32\include\glib-2.0\glibconfig.h
3. Try to build a program using glib :
#include (iostream)#include (glib.h)#include (glib/gprintf.h)int main(int argc, char* argv[]){gchar ch[128];g_sprintf(ch, "hello world");std::cout((g_strup(ch)((std::endl;return 0;}
4. Before running your new program, put all libg*.dll in F:\glib\glib_2.24.0_dll\bin to your working directory (eg. Debug/).
Ref: