Why can't I build a “hello world” for glib?

前端 未结 5 1455
走了就别回头了
走了就别回头了 2021-01-30 13:26

So here\'s the world\'s simplest glib program:

#include 

I try to compile it with gcc test.c and I get:



        
5条回答
  •  [愿得一人]
    2021-01-30 13:37

    I am using glib.h as well- Do this to compile all your glib.h programs :)

    gcc `pkg-config --cflags --libs glib-2.0` filename.c
    

    Make sure to surround pkg-config --cflags --libs glib-2.0 with back-quotes which you find under tilde (left most key on the querty keyboard).

    Thank me later .. :P

提交回复
热议问题