xantares / nfc-bindings

scripting language bindings for libnfc
BSD 3-Clause "New" or "Revised" License
23 stars 9 forks source link

Bindings not working with older swig. #3

Closed lesbeben closed 9 years ago

lesbeben commented 9 years ago

Hi! First of all, thank you for your work on this port. I tried to install your bindings on kali linux (based on debian stable). The install runs smoothly, but when I try to run the example script from the readme, I get:

Traceback (most recent call last):
  File "./example.py", line 2, in <module>
    import nfc
  File "/home/beben/.local/lib/python2.7/site-packages/nfc.py", line 30, in <module>
    _nfc = swig_import_helper()
  File "/home/beben/.local/lib/python2.7/site-packages/nfc.py", line 26, in swig_import_helper
    _mod = imp.load_module('_nfc', fp, pathname, description)
ImportError: /home/beben/.local/lib/python2.7/site-packages/_nfc.so: undefined symbol: iso14443b_crc

I'm guessing this is a swig error, since kali is running 2.0.7, which is quite old. Do you know what the lowest compatible version of swig is ? It might be a good idea to mention it in the readme!

Cheers.

xantares commented 9 years ago

Hi,

I think any version of swig should be ok for python 2.x.

Found it, was a bug in libnfc 1.7.0: https://github.com/xantares/nfc-bindings/commit/7bf96db5e8695087157bd635f88c6d090185e106

Are you sure you're using 1.7.1 ?

lesbeben commented 9 years ago

Hi, thanks for your reply! I've tried swig 2.0.12 and 3.0.5, to no avail... I am using the 1.7.1 release, straight from github, and python 2.7.3. Cmake is 2.8.9 I installed with cmake -DCMAKE_INSTALL_PREFIX=/usr . foloowed by `sudo make install`` Sad thing is, your bindings and example work out of the box on my arch, but I can't figure out what debian lacks that might cause this...

xantares commented 9 years ago

like I said, it's not a matter of swig version, but the verison of libnfc you can try to compare the symbols available in the two .so in debian/arch with nm, in my opinion debian is not really providing 1.7.1: http://anonscm.debian.org/cgit/collab-maint/libnfc.git/tree/debian/libnfc5.symbols i close this bug as it's rather a debian thing

lesbeben commented 9 years ago

All right, but like I said, I'm not using debian's libnfc but github's, since debian does not provide 1.7.1

xantares commented 9 years ago

lokks like 1.7.1 to me: https://packages.debian.org/source/jessie/libnfc

anyway you're sure you're using the 1.7.1 tag ? or the master ?

lesbeben commented 9 years ago

Kali linux uses wheezy, and as such is a little late. Definitely using the 1.7.1, from the archive on the release page, however I noticed that libnfc.so does not have any symbols in it. Clearly the bug is not on your side, I apologize for bothering you!