Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for ImportError: /usr/local/lib/python<x>.<y>/dist-packages/hid.so: undefined symbol: libusb_open #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

parautenbach
Copy link

...12 and Ubuntu 12.04. Thanks to Stéfan van der Walt's help on this.

….1.12 and Ubuntu 12.04. Thanks to Stéfan van der Walt's help on this.
@qdot
Copy link

qdot commented Nov 26, 2012

Hey! I've forked and now have my repo following HEAD (or at least, LKG HEAD from when I built last, as HIDAPI updates frequently :) ) of the hidapi repo, building against it directly. I'm also adding in more function support (I need things like path-based opening and feature report getting). I also brought in parautenbach's patch, and am going to try to shore up the setup.py to get this pip-worthy. It's at

http://www.github.com/qdot/cython-hidapi

Thanks so much for getting the base of this going! :D

@@ -3,9 +3,10 @@
from Cython.Distutils import build_ext
import os
os.environ['CFLAGS'] = "-I/usr/include/libusb-1.0"
os.environ['LDFLAGS'] = "-L/usr/lib/i386-linux-gnu -lusb-1.0 -ludev -lrt"
os.environ['LDFLAGS'] = "-L/usr/lib/x86_64-linux-gnu -lusb-1.0 -ludev -lrt"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be changed to the following code to support 64 or 32 bit system

import struct

if struct.calcsize("P") == 8:   # 64 bit
    os.environ['LDFLAGS'] = "-L/usr/lib/x86_64-linux-gnu -lusb-1.0 -ludev -lrt"
else:
    os.environ['LDFLAGS'] = "-L/usr/lib/i386-linux-gnu -lusb-1.0 -ludev -lrt"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants