Phython Programming and GUIs -- how to compile _simple_ftdi

The topic on number crunching

Phython Programming and GUIs -- how to compile _simple_ftdi

Postby RüdigerK » Wed Dec 07, 2016 8:25 pm

Hi,

can somebody tell me, how to compile
_simple_ftdi.c
with the correct parameters and libraries for
ubuntu 16.04.1 LTS xenial 64bit.

It seems, that the version of _simple_ftdi on the DVD is 32bits.

Kind Regards
RüdigerK
 
Posts: 2
Joined: Wed Dec 07, 2016 7:57 pm

Re: Phython Programming and GUIs -- how to compile _simple_f

Postby shadders » Thu Dec 08, 2016 1:23 pm

Hi,

I am not aware of the DVD or the file you are using, but the filename has the extension "c" which is a c programming language code file, and your post title has Python as the language.

Is this a mistake?

Regards,

Shadders.
shadders
 
Posts: 54
Joined: Thu Jan 02, 2014 10:37 am

Re: Phython Programming and GUIs -- how to compile _simple_f

Postby RüdigerK » Thu Dec 08, 2016 2:49 pm

Hi,

no, it is correct.

In the book p.72 I have to import _simple_ftdi

>>>import _simple_ftdi

I get the error message:
ImportError: ./_simple_ftdi.so: wrong ELF class: ELFCLASS32

so the file import _simple_ftdi.so which comes with the DVD is 32bit version.

My workstation is 64 bit.
So I tried to compile a 64bit version of _simple_ftdi.so from simple_ftdi.c

sudo swig -python simple_ftdi.i
gcc -O2 -fPIC -c simple_ftdi.c simple_ftdi_wrap.c -I/usr/include/python2.7
gcc -shared simple_ftdi.o simple_ftdi_wrap.o -o _simple_ftdi.so -l ???

The first 2 steps worked.
But which are the libftdi libraries for linking?
RüdigerK
 
Posts: 2
Joined: Wed Dec 07, 2016 7:57 pm


Return to Microcontrollers & Embedded

Who is online

Users browsing this forum: No registered users and 1 guest