On 2/19/2013 08:12, Xiaofan Chen wrote: > On Tue, Feb 19, 2013 at 6:12 AM, JonY <[email protected]> wrote: >> On 2/18/2013 22:56, Xiaofan Chen wrote: >>> Ref: >>> http://developer.intra2net.com/mailarchive/html/libftdi/2013/msg00137.html >>> >>> I am trying to build the 64bit Python (2.7.3 and 3.3) bindings for >>> libftdi1-1.0 ( http://www.intra2net.com/en/developer/libftdi/download.php ) >>> with MinGW-w64 (Ruben personal build 4.7.2 release). >>> But somehow it does not work. >>> >>> I am trying using the instructions here. >>> http://stackoverflow.com/questions/11182765/how-can-i-build-my-c-extensions-with-mingw-w64-in-python >>> >>> For 64bit Python 2.7.3, I did the following. >>> 1) gendef.exe python27.dll >>> 2) dlltool.exe --dllname python27.dll --def python27.def --output-lib >>> libpython27.a >>> 3) Copy libpython27.a to C:\Python27\libs >>> >>> Strangely, gendef has already used Py_InitModule4_64 but I need >>> to rename it back to Py_InitModule4 to get the Python binding build >>> successfully. >>> >>> But the resultant Python bindings do not work. Just FYI, >>> 32bit Python binding works very well but I do not need >>> to use gendef and dlltool there since the default 32bit >>> Python windows binaries already provide the import >>> library libpython27.a. >> >> That is because your def don't match the DLL, you just >> messed with it. > > The problem is that if I do not change the def file, I will > have the following compile error. >
That is because you just made up your own symbol, there was no such
symbol in the DLL. Changing the def file by hand is one way to cause
programs to fail when linked to the import library.
>>> c:\work\libftdi\libftdi1-1.0\examples\python>python
>>> Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)]
>>> on win
>>> 32
>>> Type "help", "copyright", "credits" or "license" for more information.
>>>>>> import ftdi1 as ftdi
>>> Traceback (most recent call last):
>>> File "<stdin>", line 1, in <module>
>>> File "C:\python27\lib\site-packages\ftdi1.py", line 30, in <module>
>>> _ftdi1 = swig_import_helper()
>>> File "C:\python27\lib\site-packages\ftdi1.py", line 26, in
>>> swig_import_helper
>>> _mod = imp.load_module('_ftdi1', fp, pathname, description)
>>> ImportError: DLL load failed: The specified procedure could not be found.
>>>
>>
>> Use dependency walker to find out if you really have a _ftdi1 export.
>
> Seems to be fine.
>
You should ask a python specific list for help on the Python programming
language or Swig for help on Swig.
I don't think this is mingw-w64 related anymore.
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
