Polyconseil / zbarlight

A simple wrapper for zbar
BSD 3-Clause "New" or "Revised" License
163 stars 37 forks source link

`zbar.h` not found on macOS. #16

Closed Junzki closed 7 years ago

Junzki commented 7 years ago

I've installed zbar with homebrew, and pip said he couldn't find zbar.h. Symptom like this below.

src/zbarlight/_zbarlight.c:3:10: fatal error: 'zbar.h' file not found
#include <zbar.h>
         ^
1 error generated.
error: command 'clang' failed with exit status 1

And here is a possible solution:

env LDFLAGS="-L$(brew --prefix zbar)/lib" \
CFLAGS="-I$(brew --prefix zbar)/include" \
pip install zbarlight
fbochu commented 7 years ago

Thanks for the report.

We use zbarlight at worker, and for now none of my co-workers that use MacOS complaint about the installation of zbarlight. I will see with them how they install it.

xordoquy commented 7 years ago

This is strange. Did you customize the brew install path ?

Everything should have gone into /usr/local/ which should already be in the various PATHs.

flaub commented 7 years ago

I've also run into this on MacOS 10.12.

Here's what clang is trying to do:

clang -fno-strict-aliasing -fno-common -dynamic -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -I/usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/zbarlight/_zbarlight.c -o build/temp.macosx-10.13-x86_64-2.7/src/zbarlight/_zbarlight.o -std=c99
    src/zbarlight/_zbarlight.c:3:10: fatal error: 'zbar.h' file not found

Using @Junzki solution works for me.

fbochu commented 7 years ago

Thanks for you comment, I will update the installation instructions to take into account that.