3

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

按照这些说明,我尝试了:

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

dll工具版本:

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.
4

1 回答 1

2

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

通过使用以下标志安装 MinGw 解决了该问题architecture = x86_64, threads = posix, exception = seh:Path toMinGw\bin必须添加到 Windows 的 Path 环境变量中。

于 2016-06-23T06:46:29.813 回答