libftdi Archives

Subject: Re: Building 64bit Python binding under Windows

From: Xiaofan Chen <xiaofanc@xxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Mon, 18 Feb 2013 12:10:06 +0800
On Sat, Feb 16, 2013 at 10:32 PM, Xiaofan Chen <xiaofanc@xxxxxxxxx> wrote:
> I just tried to build 64bit Python 2.7.3 binding under
> Windows Vistaq 64bit. Somehow it failed. Other
> things are fine (not building Boost binding, the
> unit test program and ftdi_eeprom).
>
> What could be the problem?
>
> Scanning dependencies of target _ftdi1
> [ 47%] Building C object bindings/CMakeFiles/_ftdi1.dir/ftdi1PYTHON_wrap.c.obj
> Linking C shared module _ftdi1.pyd
> CMakeFiles/_ftdi1.dir/objects.a(ftdi1PYTHON_wrap.c.obj): In function 
> `SWIG_Pytho
> n_ErrorType':
> c:/work/libftdi/libftdi1-1.0/mingw64_rvb/bindings/ftdi1PYTHON_wrap.c:989: 
> undefi
> ned reference to `__imp_PyExc_RuntimeError'

Google seems to point out the main reason. Python.org binaries does not
provide the libpythonxx.a (MinGW import library) for 64bit Python even
though it does that for 32bit Python.

Found this link.
http://stackoverflow.com/questions/11182765/how-can-i-build-my-c-extensions-with-mingw-w64-in-python

Firstly tried Python 2.7 64bit, the building process is fine but
it does not be able to load the module.
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.

Then I tried Python 3.3 and it seems to go fine when building the
Python bindings. But then it failed to load the module and says
that "Python.exe has stopped working".

-- 
Xiaofan

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread