使用Python 3支持编译gVim
我希望这是提出这个问题的正确地点: 我正在尝试在windows下使用cygwin编译支持python 3的gVim: 我将Make_cyg.mak files Python部分更改为以下内容:使用Python 3支持编译gVim,python,vim,compilation,python-3.x,Python,Vim,Compilation,Python 3.x,我希望这是提出这个问题的正确地点: 我正在尝试在windows下使用cygwin编译支持python 3的gVim: 我将Make_cyg.mak files Python部分更改为以下内容: ############################## # DYNAMIC_PYTHON=yes works. # DYNAMIC_PYTHON=no does not (unresolved externals on link). ############################## if
##############################
# DYNAMIC_PYTHON=yes works.
# DYNAMIC_PYTHON=no does not (unresolved externals on link).
##############################
ifdef PYTHON
DEFINES += -DFEAT_PYTHON
INCLUDES += -I$(PYTHON)/include
EXTRA_OBJS += $(OUTDIR)/if_python.o
ifndef DYNAMIC_PYTHON
DYNAMIC_PYTHON = yes
endif
ifndef PYTHON_VER
PYTHON_VER = 30
endif
ifeq (yes, $(DYNAMIC_PYTHON))
DEFINES += -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\"
else
EXTRA_LIBS += $(PYTHON)/libs/python$(PYTHON_VER).lib
endif
endif
但是,在运行时:
$ make -f Make_cyg.mak OLE=Yes PYTHON=/cygdrive/p/Applications/PortablePython_1.1_py3.0.1/App/ RUBY=/cygdrive/c/Programme/Ruby/
这将导致以下错误:
In file included from /cygdrive/p/Applications/PortablePython_1.1_py3.0.1/App//i
nclude/Python.h:70,
from if_python.c:43:
/cygdrive/p/Applications/PortablePython_1.1_py3.0.1/App//include/bytesobject.h:1
04:1: warning: "F_BLANK" redefined
In file included from globals.h:1554,
from vim.h:1831,
from if_python.c:20:
farsi.h:74:1: warning: this is the location of the previous definition
if_python.c:729: warning: initialization makes integer from pointer without a ca
st
if_python.c:733: warning: initialization from incompatible pointer type
if_python.c:734: warning: initialization from incompatible pointer type
if_python.c:735: warning: initialization from incompatible pointer type
if_python.c:737: error: `cmpfunc' undeclared here (not in a function)
if_python.c:737: error: initializer element is not constant
if_python.c:737: error: (near initialization for `OutputType.tp_repr')
if_python.c:737: error: parse error before numeric constant
/** more errors **/
if_python.c:2256: warning: initialization from incompatible pointer type
if_python.c:2257: warning: initialization from incompatible pointer type
if_python.c: In function `PythonMod_Init':
if_python.c:2351: error: structure has no member named `ob_type'
if_python.c:2352: error: structure has no member named `ob_type'
if_python.c:2353: error: structure has no member named `ob_type'
if_python.c:2354: error: structure has no member named `ob_type'
if_python.c:2355: error: structure has no member named `ob_type'
if_python.c:2356: error: structure has no member named `ob_type'
make: *** [gobj/if_python.o] Error 1
我使用的是一个可移植的python安装程序。我不知道这是否是错误的根源
我希望有人知道如何使用Python3支持编译vim(如果我只使用ruby支持编译它,它会编译得很好)
提前感谢,
贾拉尔这里同时发生了很多事情。首先,为什么要使用Python 3.0?如果您真的想要Python3,那么应该使用Python3.1 其次,在gVim的情况下,“Python3支持”意味着什么?是用Python进行扩展吗?那么您就不需要Python3支持,因为gVim的任何扩展都是为Python2编写的 是的,使用可移植python似乎很奇怪。由于您是使用cygwin编译gVim,因此应该合理地使用使用相同cygwin编译的Python
Windows的普通gvim不支持Python吗?我已经用Python 3支持编译了vim。以下是vim 7.2.411的更新版本 有关编译说明,请查看我2009年9月22日的邮件 groups.google.com/group/vim_dev/browse_frm/month/2009-09
(添加第二个超链接不起作用)Hi,我尝试用Portable Python编译它,因为我也想在Portable gVim中使用生成的exe。您需要使用PYTHON和RUBY集编译vim,以访问这些语言的自动完成特性。(我想至少是这样-我对vim还不熟悉)在用RUBY编译vim的情况下,它与新的vim自动完成功能配合得很好。当我想学习Python3时,我想能够将vim与我的便携式Python3(目前Python3.1中没有vim)一起使用会很好。希望这些信息有帮助,谢谢你花时间帮助我Gjarlari认为编译它所用的python版本不会对自动完成特性产生影响。我不知道vim中的自动完成功能是如何工作的,但是Python 3支持很可能完全独立于您编译它所使用的Python版本。自动完成功能不是Python的一部分,而是vim的一部分。@Gjarlar:另外,您肯定想使用Python 3.1。简而言之,我看不出有什么理由不使用为Windows编译的标准版本的vim。您很可能试图修复错误的问题。