vim - 从 Cygwin 编译 vim (Versin>=7.4.399) 时显示错误 "collect2: error: ld returned 1 exit status"

标签 vim cygwin

我厌倦了维护最新的 Windows VIM/GVIM,here是我的开源项目。

但是,我发现由于vim版本高于v7.4.399(包括v7.4.399),cygwin编译总是失败

低于v7.4.399的版本可以用同样的命令编译成功!

失败信息:

obj/ex_docmd.o:ex_docmd.c:(.text+0x45f): undefined reference to `crypt_get_key'
obj/fileio.o:fileio.c:(.text+0xbb7): undefined reference to `crypt_works_inplace'
obj/fileio.o:fileio.c:(.text+0xbe6): undefined reference to `crypt_encode_alloc'
obj/fileio.o:fileio.c:(.text+0xd69): undefined reference to `crypt_encode_inplace'
obj/fileio.o:fileio.c:(.text+0x69e3): undefined reference to `crypt_free_state'
obj/fileio.o:fileio.c:(.text+0x6c66): undefined reference to `crypt_free_state'
obj/fileio.o:fileio.c:(.text+0x6c97): undefined reference to `crypt_free_key'
obj/fileio.o:fileio.c:(.text+0x716f): undefined reference to `crypt_get_method_nr'
obj/fileio.o:fileio.c:(.text+0x7177): undefined reference to `crypt_get_header_len'
obj/fileio.o:fileio.c:(.text+0x8e48): undefined reference to `crypt_works_inplace'
obj/fileio.o:fileio.c:(.text+0x8e73): undefined reference to `crypt_decode_inplace'
obj/fileio.o:fileio.c:(.text+0x906d): undefined reference to `crypt_method_nr_from_magic'
obj/fileio.o:fileio.c:(.text+0x9098): undefined reference to `crypt_set_cm_option'
obj/fileio.o:fileio.c:(.text+0x90c8): undefined reference to `crypt_create_from_header'
obj/fileio.o:fileio.c:(.text+0x90df): undefined reference to `crypt_set_cm_option'
obj/fileio.o:fileio.c:(.text+0x90e7): undefined reference to `crypt_get_header_len'
obj/fileio.o:fileio.c:(.text+0x9158): undefined reference to `crypt_decode_alloc'
obj/fileio.o:fileio.c:(.text+0x9e3f): undefined reference to `crypt_append_msg'
obj/fileio.o:fileio.c:(.text+0x9ed4): undefined reference to `crypt_get_method_nr'
obj/fileio.o:fileio.c:(.text+0x9edc): undefined reference to `crypt_get_header_len'
obj/fileio.o:fileio.c:(.text+0xa5bc): undefined reference to `crypt_get_key'
obj/fileio.o:fileio.c:(.text+0xca32): undefined reference to `crypt_free_state'
obj/fileio.o:fileio.c:(.text+0xdd15): undefined reference to `crypt_get_method_nr'
obj/fileio.o:fileio.c:(.text+0xdd37): undefined reference to `crypt_create_for_writing'
obj/fileio.o:fileio.c:(.text+0xe2d2): undefined reference to `crypt_append_msg'
/usr/lib/gcc/i686-pc-mingw32/4.7.3/../../../../i686-pc-mingw32/bin/ld: obj/fileio.o: bad reloc address 0x2e8 in section `.rdata'
/usr/lib/gcc/i686-pc-mingw32/4.7.3/../../../../i686-pc-mingw32/bin/ld: final link failed: Invalid operation
collect2: error: ld returned 1 exit status
Make_cyg.mak:603: recipe for target 'vim.exe' failed
make: *** [vim.exe] Error 1

编译命令:

 make -B -f Make_cyg.mak PYTHON=/cygdrive/c/Marslo/MyProgramFiles/Python27 DYNAMIC_PYTHON=yes PYTHON_VER=27 PYTHON3=/cygdrive/c/Marslo/MyProgramFiles/Python34 DYNAMIC_PYTHON3=yes PYTHON3_VER=34 FEATURES=huge IME=yes GIME=yes MBYTE=yes CSCOPE=yes USERNAME=Marslo.Jiao USERDOMAIN=China GUI=no

我检查了differencev7-4-398v7-4-399 之间,发现有一些内容通过加密进行了更新。然后我在 cygwin 中添加了有关 crypt 的库和其他内容,如下所示,但编译仍然无法工作...... crypt

如何才能编译更高版本的vim?


环境:

  • Cygwin 版本:最新 setup-x86_64.exemintty 1.2-beta1 (x86_64-pc-cygwin)

最佳答案

您是否尝试过使用当前可用的所有补丁进行编译。我认为 Bram Moolenaar(vim 维护者)忘记在其中一个补丁中添加一些文件,后来的一个补丁修复了这个问题。如果没有发帖到<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b9cfd0d4e6dddccff9cfd0d497d6cbde" rel="noreferrer noopener nofollow">[email protected]</a>

这也被报告给https://groups.google.com/forum/#!topic/vim_dev/D8FyRd0EwlE .

补丁 7.4.401 应该修复它 https://groups.google.com/forum/#!topic/vim_dev/q0dbl0_9k9U

关于vim - 从 Cygwin 编译 vim (Versin>=7.4.399) 时显示错误 "collect2: error: ld returned 1 exit status",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25566503/

相关文章:

python - 如何让vim自动在开头写入固定注释?

vim - 使 NERDTree 工作 'as expected'

ruby - cygwin 使用什么版本的 ruby​​?

ruby - 无法在 Cygwin 中使用 RVM 安装 ruby​​ - curl SSL 证书问题

linux - 更改 Linux 上 VIM 插入标记的外观?

vim定界伴侣

vim - 为命令使用状态栏(即 :s or :g) in gVim

bash - Cygwin 从一个批处理文件运行脚本?

python - HTTPS 请求导致 Windows 中使用 Python 3 重置连接

c++ - 无法在 Windows 8 的 Cygwin 上编译基本的 C++ 程序