zplab / zbar-py

Simple python 2 and 3 compatible interface to the zbar barcode-reading library
MIT License
82 stars 30 forks source link

Wont build on windows 10 #4

Closed irbigturtle closed 5 years ago

irbigturtle commented 7 years ago

Trying to build after installing both "Microsoft Visual C++ Compiler for Python 2.7" and "iconv".

I installed inconv using the .exe, was I supposed to do it differently?

When I try to install zbar-py using pip I get this:

c:\python27\include\pyport.h(9) : fatal error C1083: Cannot open include file: 'inttypes.h': No such file or directory error: command 'C:\\Users\\Christian\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2

I tried downloading inttypes.h from here: https://code.google.com/archive/p/msinttypes/downloads and tried placing it in the respective \include\ and \bin\ directories. Neither is working.

markbasham commented 6 years ago

+1 on this is anyone is looking :)

rounaksingh commented 6 years ago

Hi irbigturtle, There are two .h files on the link. stdint.h and inttypes.h. For VC++ for python2.7 you will have to copy it in C:\Users\<user-name>\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\include

It should work I have used this method to build other packages.

Thanks

rounaksingh commented 6 years ago

Hi I am trying to build it in windows, I have some other errors. The code is not MSVC ported. Check out Issue #8.

Moreover, VC9 for python 2.7 does not support the new coding standards uses old C89. https://stackoverflow.com/questions/13308944/how-to-simulate-c99-in-visual-studio-for-variables-declaration I have run into simple inline declarations compiling error in zbar.h and others. Also, more error. Someone has to port whole code in c++ that might work or use https://github.com/libav/c99-to-c89.

Its better to work for python3+ in my opinion. Python 2 will be obsolete in future, it is only for support not for development.