如何使用gcc,包括所需的C库? [英] How to include needed C library using gcc?

查看:464
本文介绍了如何使用gcc,包括所需的C库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图编译从这个简单的C例子<一个href=\"https://wiki.ubuntu.com/DesktopExperienceTeam/ApplicationIndicators#Typical%20usage%20%28C%20version%29\">Tutorial在Ubuntu上使用gcc。我有什么作为参数用于GCC包括对需要的库的#include&LT; libappindicator / APP-indicator.h&GT;

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 #include <libappindicator/app-indicator.h>?

推荐答案

如果您使用 apt-get的新立得软件包管理器等来获得 appindicator 库(与从源代码构建它),你只安装 libappindicator1 包还是你的的安装 libappindicator-dev的来获得 libappindicator 头文件? Linux软件包往往有分裂在编译时头运行时库。这种方式,人们谁只需要的库,以满足动态链接不必安装不需要的头。但由于你在做开发,你需要这些头,因此需要在 libappindicator-dev的软件包。

If you used apt-get, Synaptic Package Manager, etc. to get the appindicator library (vs. building it from source), did you only install the libappindicator1 package or did you also install libappindicator-dev to get the libappindicator header files? Linux packages very often have split the runtime libraries from the compile-time headers. That way people who only need the libraries to satisfy a dynamic link don't have to install unneeded headers. But since you're doing development you need those headers and therefore need the libappindicator-dev package as well.

这篇关于如何使用gcc,包括所需的C库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆