Chinaunix

标题: [求助] 安装Pyqt时 make出错 [打印本页]

作者: LuffyLiu    时间: 2014-04-08 15:14
标题: [求助] 安装Pyqt时 make出错
具体错误信息如下:

/usr/bin/ld: cannot find -lpython2.7m
collect2: error: ld returned 1 exit status
make[1]: *** [libpyqt4.so] Error 1
make[1]: Leaving directory `/maxwit/build/ExtractDir/PyQt-x11-gpl-4.10.4/designer'
make: *** [all] Error 2

自己google过第二条,但网友都说: 1.后台有程序运行。   2. 槽函数    3.在头文件中定义了函数但却没有函数体
看完之后还是不明白, 请大家帮忙分析下错误原因, 谢谢!
作者: MWSandy    时间: 2014-04-08 16:27
看错误应该是链接时出错。看看你系统上有没有安装python2.7m这个库,即libpython2.7m.so
1. 如果没有,需要安装相应的包
2. 如果有,看地址是否在/etc/ld.so.conf列表里
作者: MWSandy    时间: 2014-04-08 16:28
或者库名写错了?不是libpython2.7m.so,而是libpython2.7.so?
作者: LuffyLiu    时间: 2014-04-08 19:14
谢谢 sandy!

我有看了下我的系统中  没有libpython2.7m.so  而有libpython2.7.so   于是我把libpython2.7.so这个库的路径 加入到/etc/ld.so.conf中 格式如下:

include /etc/ld.so.conf.d/*.conf
include /usr/bin/i386-linux-gnu/libpython2.7.so
include /usr/bin/python2.7/config-i386-linux-gnu/libpython2.7.so

然后我再次Make   结果还是一样的错,  我现在认为是链接时库的名字写错了  我想把他改成libpython2.7.so  可是我不知道该去改哪里? 是在Makefile里面改库名吗?还是在别的地方呢?
作者: MWSandy    时间: 2014-04-08 22:22
本帖最后由 MWSandy 于 2014-04-08 22:28 编辑

首先,路径不需要再加入ld.so.conf文件了,因为其中的第一条已经包含了/usr/bin/i386-linux-gnu目录,并且你写的方法是错误的:)
其次,修改链接库的名字一般是在Makefile里,你可以在源码目录下搜索一下,将错误的库名统一修改掉

Good luck




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2