加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

编译别人的程序最大的悲哀莫过于那人太依赖libtool、pkg-config

发布时间:2020-12-14 02:15:11 所属栏目:百科 来源:网络整理
导读:编译别人的程序最大的悲哀莫过于那人太依赖libtool、pkg-config这些工具 编译libinput,相信很多像这样的程序,执行./configure都会有 PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_L

编译别人的程序最大的悲哀莫过于那人太依赖libtool、pkg-config这些工具

编译libinput,相信很多像这样的程序,执行./configure都会有

PKG_CONFIG path to pkg-config utility
PKG_CONFIG_PATH
directories to add to pkg-config's search path
PKG_CONFIG_LIBDIR
path overriding pkg-config's built-in search path


设置好PKG_CONFIG_PATH后,configure一切OK,依赖库关系解决。


但是真正悲哀的是pkg-config遇到了libtool,只用Libtool去编译的时候,依然会提示你xxx.h: No such file or directory


CCLD libinput.la
CC libfilter_la-filter.lo
In file included from libinput-private.h:33,
from filter.h:33,
from filter.c:35:
libinput.h:34:21: error: libudev.h: No such file or directory


去查看Makefile,可以看到pkgconfig下的.pc中的内容,pkg-config确实没问题,configure已经把pkg-config中的内容提取了,但是对于libtool来说,依然没有。


搞得我烦死了,真想直接修改Makefile,直接使用gcc编译了。


无奈啊,项目者使用libtool是方便了,但我们这些编译者就痛苦了。


我相信很多人管理Linux下的程序项目是都会去用automake、autoconf这些工具管理生成configure、Makefile这些配置文件。


但工具始终是工具,不是万能的,有时候生成的也是乱的,而且还那么复杂,还不如自己写个快。就算是能把依赖关系提示出来,但又怎样,会自动帮编译者解决吗?


不会!!!还得编译者自己去编译所依赖的包或者去确定这些包。这和直接make编译时提示缺少xx.h .xx.so有什么区别???

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读