How to include needed C library using gcc?

前端 未结 6 806
难免孤独
难免孤独 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:39

    What you are trying to do here is making a gtk app, the above solutions are as applicable anywhere like using the -l option and -I option,

    However for GTK apps you may also use pkg-config which make it easier as your paths can be predefined

    http://www.freedesktop.org/wiki/Software/pkg-config

    An interesting example can be found here http://developer.gnome.org/gtk/2.24/gtk-compiling.html

提交回复
热议问题