gpt4 book ai didi

python - dlltool:无法创建 .lib 文件:libpython27.a:无效的 bfd 目标

转载 作者:可可西里 更新时间:2023-11-01 09:28:26 25 4
gpt4 key购买 nike

我正在尝试在 Windows 7 x64 上从 python27.dll 构建 64 位版本的 libpython27.a

按照这些 instructions ,我试过:

E:\temp>gendef python27.dll
* [python27.dll] Found PE+ image

E:\temp>dlltool --as-flags=--64 -m i386:x86-64 -k --output-lib libpython27.a --i
nput-def python27.def
dlltool: Can't create .lib file: libpython27.a: Invalid bfd target

什么可以解释 dlltool: Can't create .lib file: libpython27.a: Invalid bfd target?

dlltool 版本:

E:\temp>dlltool -V
GNU dlltool (GNU Binutils) 2.23.2
Copyright 2012 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.

最佳答案

我正好遇到了这个问题。我的 MinGw 安装了 architecture = i686。这是默认选择,我忘记在安装过程中更改它。

通过使用这些标志安装 MinGw 解决了这个问题:architecture = x86_64, threads = posix, exception = sehMinGw\bin 的路径必须添加到 Windows 的 Path 环境变量中。

关于python - dlltool:无法创建 .lib 文件:libpython27.a:无效的 bfd 目标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33686922/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com