2010年4月25日 星期日

Using glib in Windows (vc 2005 settings)

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:

2010年4月20日 星期二

[windows] kill a process by name xx.exe

taskkill /F /IM myprocess.exe

ref:
taskkill /?

2010年4月13日 星期二

(windows) create a empty file of fixed size

fsutil file createnew test.dat 100000000

(create a empty file of size 100MB)