title: dlltool: Can't create .lib file: libpython27.a: Invalid bfd target
body: <p>I'm trying to build a 64-bit version of <code>libpython27.a</code> from <code>python27.dll</code> on Windows 7 x64.</p>
  
  <p>Following these <a href="http://rosinality.ncity.net/doku.php?id=python:installing_theano" rel="nofollow">instructions</a>, I tried:</p>
  
  <pre><code>E:\temp&gt;gendef python27.dll
   * [python27.dll] Found PE+ image
  
  E:\temp&gt;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
  </code></pre>
  
  <p>What can explain <code>dlltool: Can't create .lib file: libpython27.a: Invalid bfd target</code>?</p>
  
  <p>dlltool version:</p>
  
  <pre><code>E:\temp&gt;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.
  </code></pre>