컴퓨터/기타

Cairo]Hello, World

예섬수진 2010. 8. 11. 00:08
(1) Executed Result
  - A executable file will create png file which contains "Hello, world"

(2) Source code [hello.c]

(3) How to compile code
  1)  check if the system has pkg-config
    * you don't specify path of Cairo libraries and header files when you compile code using pkg-config
 
  2) set PKG_CONFIG_PATH environment variable
    a) for bash
       export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
    b) for csh
setenv PKG_CONFIG_PATH /usr/local/lib/pkgconfig
 * How to check shell type : enter "echo $SHELL"
   3) compile hello.c
     a) for bash
       cc -o hello $(pkg-config --cflags --libs cairo) hello.c

      b) for csh
       cc -o hello `pkg-config --cflags --libs cairo` hello.c

      * After compile code, you can see created exe file (hello)

(4) Reference