{"id":5316,"date":"2014-03-30T20:39:34","date_gmt":"2014-03-30T20:39:34","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/building-64bit-libpython27-a-using-cygwin-dlltool-collection-of-common-programming-errors\/"},"modified":"2014-03-30T20:39:34","modified_gmt":"2014-03-30T20:39:34","slug":"building-64bit-libpython27-a-using-cygwin-dlltool-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/building-64bit-libpython27-a-using-cygwin-dlltool-collection-of-common-programming-errors\/","title":{"rendered":"Building 64bit libpython27.a using cygwin, dlltool-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;m trying to build a python extension DLL on a 64bit Win7 machine using cygwin (as cygwin only run as 32bit process, this is actually cross-compiling).<\/p>\n<p>I created libpython27.a myself from python27.dll using dlltool (as explained, for example, here), but the build fail during the linker phase saying<br \/>\n<code>skipping incompatible c:\\Python27\\libs\/libpython27.a when searching for -lpython27<\/code><br \/>\nThis is exactly the error reported here (where the guy ended up moving to MSVC compiler&#8230;).<\/p>\n<p>More info: &#8211; Active Python 2.7.2, win64, x64<\/p>\n<p>&#8211; latest version of cygwin, using the \/usr\/bin\/x86_64-w64-mingw32-g++.exe compiler<\/p>\n<p><strong>Does anyone know if this is supported?<br \/>\nIs there way to use dlltool which I miss here?<\/strong><\/p>\n<p>(I did found here the guidance to use<br \/>\n<code>dlltool --as-flags=--64 -m i386:x86-64 -k -l libpython27.a -d python.def<\/code><br \/>\nbut when doing so I got <code>\"invalid bfd target\"<\/code> error from dlltool)<\/p>\n<p>Thanks!<\/p>\n<p><strong>Update<\/strong>: I believe it can be done because Enthought python contains such a file. I would like to create one for the more common distributions which don&#8217;t contain it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m trying to build a python extension DLL on a 64bit Win7 machine using cygwin (as cygwin only run as 32bit process, this is actually cross-compiling). I created libpython27.a myself from python27.dll using dlltool (as explained, for example, here), but the build fail during the linker phase saying skipping incompatible c:\\Python27\\libs\/libpython27.a when searching for -lpython27 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5316","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5316","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5316"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5316\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5316"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5316"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5316"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}