bensondaled / pseyepy

PSEye-py: a python interface to the PS3Eye camera
Apache License 2.0
78 stars 26 forks source link

library not found for -lusb #3

Closed zalavariandris closed 6 years ago

zalavariandris commented 6 years ago

Hi,

I wast trying to run the install script and bumped into an error. I am on Mac Os High Sierra. Installed lubusb and ffmped with brew.

:pseyepy-master andris$ python3 setup.py install
running install
running build
running build_ext
building 'pseyepy.cameras' extension
g++ -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Ipseyepy/src -I/usr/local/Cellar/libusb/1.0.21/include/libusb-1.0 -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c pseyepy/cameras.cpp -o build/temp.macosx-10.12-x86_64-3.6/pseyepy/cameras.o -std=c++11 -stdlib=libc++
g++ -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Ipseyepy/src -I/usr/local/Cellar/libusb/1.0.21/include/libusb-1.0 -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c pseyepy/src/ps3eye.cpp -o build/temp.macosx-10.12-x86_64-3.6/pseyepy/src/ps3eye.o -std=c++11 -stdlib=libc++
g++ -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Ipseyepy/src -I/usr/local/Cellar/libusb/1.0.21/include/libusb-1.0 -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c pseyepy/src/ps3eye_capi.cpp -o build/temp.macosx-10.12-x86_64-3.6/pseyepy/src/ps3eye_capi.o -std=c++11 -stdlib=libc++
pseyepy/src/ps3eye_capi.cpp:138:15: warning: unused variable 'newCam' [-Wunused-variable]
    ps3eye_t *newCam = new ps3eye_t(id, ps3eye_context->devices[id], width, height, fps, outputFormat); // is stored in opened_devices
              ^
1 warning generated.
clang++ -bundle -undefined dynamic_lookup build/temp.macosx-10.12-x86_64-3.6/pseyepy/cameras.o build/temp.macosx-10.12-x86_64-3.6/pseyepy/src/ps3eye.o build/temp.macosx-10.12-x86_64-3.6/pseyepy/src/ps3eye_capi.o -L/usr/local/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/sqlite/lib -lusb -o build/lib.macosx-10.12-x86_64-3.6/pseyepy/cameras.cpython-36m-darwin.so -std=c++11 -stdlib=libc++
ld: library not found for -lusb
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang++' failed with exit status 1
Andriss-MacBook-Pro:pseyepy-master andris$ 

do you know how to solve it?

bensondaled commented 6 years ago

You should be able to specify the path of your specific libusb library using the library_dirs argument to Extension.

I've tried to build a pseudo-general solution to this in the setup script. Try re-pulling and attempting again?

zalavariandris commented 6 years ago

it seems to be working now! Thank you!!!

Although I had to install two modules (Pillow and h5py) for pseyepy to work. That is not listed in the dependency section. Doesn't really matter, it works well.