问题描述
所以我从源代码中获得了最新的 python-ldap.我也在运行 python 2.7.2 的源代码编译版本,我在 RHEL 上运行它.因此,当我尝试编译包时,我会收到如下所示的长错误消息.所以我安装了 openldap-devel 包,现在它是一个小得多的错误.但仍然没有编译.
So I got the latest python-ldap from source. I am also running the source compiled version of python 2.7.2 and I am running this on RHEL. So when I try to compile the package I get this long error message as seen below. So I installed the openldap-devel package and now it is a much smaller error. But still not compiling.
extra_compile_args: -g
extra_objects:
include_dirs: /opt/openldap-RE24/include /usr/include/sasl
library_dirs: /opt/openldap-RE24/lib
libs: ldap_r lber sasl2 ssl crypto
running install
running bdist_egg
running egg_info
writing requirements to Lib/python_ldap.egg-info/requires.txt
writing Lib/python_ldap.egg-info/PKG-INFO
writing top-level names to Lib/python_ldap.egg-info/top_level.txt
writing dependency_links to Lib/python_ldap.egg-info/dependency_links.txt
file Lib/ldap.py (for module ldap) not found
file Lib/ldap/controls.py (for module ldap.controls) not found
file Lib/ldap/extop.py (for module ldap.extop) not found
file Lib/ldap/schema.py (for module ldap.schema) not found
reading manifest file 'Lib/python_ldap.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'Makefile'
warning: no files found matching 'Modules/LICENSE'
writing manifest file 'Lib/python_ldap.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
file Lib/ldap.py (for module ldap) not found
file Lib/ldap/controls.py (for module ldap.controls) not found
file Lib/ldap/extop.py (for module ldap.extop) not found
file Lib/ldap/schema.py (for module ldap.schema) not found
file Lib/ldap.py (for module ldap) not found
file Lib/ldap/controls.py (for module ldap.controls) not found
file Lib/ldap/extop.py (for module ldap.extop) not found
file Lib/ldap/schema.py (for module ldap.schema) not found
running build_ext
building '_ldap' extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_LIBLDAP_R -DHAVE_SASL -DHAVE_TLS -DLDAPMODULE_VERSION=2.4.1 -IModules -I/opt/openldap-RE24/include -I/usr/include/sasl -I/opt/home/mradmin/.local/include/python2.7 -c Modules/LDAPObject.c -o build/temp.linux-x86_64-2.7/Modules/LDAPObject.o -g
In file included from Modules/LDAPObject.c:18:
/usr/include/sasl/sasl.h:349: warning: function declaration isnât a prototype
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_LIBLDAP_R -DHAVE_SASL -DHAVE_TLS -DLDAPMODULE_VERSION=2.4.1 -IModules -I/opt/openldap-RE24/include -I/usr/include/sasl -I/opt/home/mradmin/.local/include/python2.7 -c Modules/ldapcontrol.c -o build/temp.linux-x86_64-2.7/Modules/ldapcontrol.o -g
Modules/ldapcontrol.c: In function âencode_assertion_controlâ:
Modules/ldapcontrol.c:350: warning: implicit declaration of function âldap_create_assertion_control_valueâ
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_LIBLDAP_R -DHAVE_SASL -DHAVE_TLS -DLDAPMODULE_VERSION=2.4.1 -IModules -I/opt/openldap-RE24/include -I/usr/include/sasl -I/opt/home/mradmin/.local/include/python2.7 -c Modules/common.c -o build/temp.linux-x86_64-2.7/Modules/common.o -g
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_LIBLDAP_R -DHAVE_SASL -DHAVE_TLS -DLDAPMODULE_VERSION=2.4.1 -IModules -I/opt/openldap-RE24/include -I/usr/include/sasl -I/opt/home/mradmin/.local/include/python2.7 -c Modules/constants.c -o build/temp.linux-x86_64-2.7/Modules/constants.o -g
Modules/constants.c: In function âLDAPinit_constantsâ:
Modules/constants.c:153: error: âLDAP_OPT_DIAGNOSTIC_MESSAGEâ undeclared (first use in this function)
Modules/constants.c:153: error: (Each undeclared identifier is reported only once
Modules/constants.c:153: error: for each function it appears in.)
Modules/constants.c:363: error: âLDAP_CONTROL_RELAXâ undeclared (first use in this function)
error: command 'gcc' failed with exit status 1
由于这个问题已关闭,所以这不是问题,请帮助我不是问题.我想到了.我不得不手动编译最新的 ldap、berkleydb,然后用它进行构建安装.然后它构建得很好
Since this is closed because the question, this doesnt ocmpile please help me out is not a question. I figured it out. I had to manually compile the latest ldap, berkleydb, and then do a build install with it. Then it built fine
推荐答案
第一个和第二个错误消息状态你缺少 lber.h
和 ldap.h
.这是一个指向丢失或无效的 openldap-devel
包的强指针.您是否安装了该软件包(或类似的匹配 *ldap-dev*
)?
The first and second error message state that you're missing lber.h
and ldap.h
. This is a strong pointer to a missing or invalid openldap-devel
package. Do you you have that package (or a similar one matching *ldap-dev*
) installed?
这篇关于Python-LDAP 无法编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!