How to include needed C library using gcc?

前端 未结 6 805
难免孤独
难免孤独 2020-11-29 02:09

I am trying to compile the simple C example from this Tutorial on Ubuntu using gcc. What do I have to use as argument for gcc to include the needed libraries for #incl

6条回答
  •  一生所求
    2020-11-29 02:52

    gcc example.c -o example  `pkg-config --cflags --libs appindicator-0.1`
    

    pkg-config will fetch the required include and lib flags for libappindicator and it's dependencies. This assumes libappindictaor-dev package is already installed.

提交回复
热议问题