tatobari / hx711py

HX711 Python Library for Raspberry Pi.
Apache License 2.0
210 stars 153 forks source link

setuptools install hx711 err #27

Open jjeejj opened 5 years ago

jjeejj commented 5 years ago

when i exec python3 setup.py install command,an error has occurred

source/py_gpio.c:87:4: error: function definition is not allowed here
   {
   ^
source/py_gpio.c:143:10: warning: implicit declaration of function 'cleanup_one' is invalid in C99 [-Wimplicit-function-declaration]
         cleanup_one();
         ^
source/py_gpio.c:143:10: warning: this function declaration is not a prototype [-Wstrict-prototypes]
source/py_gpio.c:172:13: warning: implicit declaration of function 'cleanup_one' is invalid in C99 [-Wimplicit-function-declaration]
            cleanup_one();
            ^
source/py_gpio.c:200:24: error: function definition is not allowed here
   int setup_one(void) {
                       ^
source/py_gpio.c:293:13: warning: implicit declaration of function 'setup_one' is invalid in C99 [-Wimplicit-function-declaration]
       if (!setup_one())
            ^
source/py_gpio.c:293:13: warning: this function declaration is not a prototype [-Wstrict-prototypes]
source/py_gpio.c:323:12: warning: implicit declaration of function 'setup_one' is invalid in C99 [-Wimplicit-function-declaration]
      if (!setup_one())
           ^
source/py_gpio.c:345:21: error: function definition is not allowed here
   int output(void) {
                    ^
source/py_gpio.c:419:18: error: called object type 'PyObject *' (aka 'struct _object *') is not a function or function pointer
      if (!output())
           ~~~~~~^
source/py_gpio.c:475:18: error: called object type 'PyObject *' (aka 'struct _object *') is not a function or function pointer
      if (!output())
           ~~~~~~^
6 warnings and 5 errors generated.
error: Setup script exited with error: command 'gcc' failed with exit status 1

i want to know ,how to solve it?

tatobari commented 7 months ago

@jjeejj Are you still interested on using this library and solving this issue? A new version is available and doesn't need setup.py.