I am creating a server for the Raspberry Pi and I am partially writing the code using OS X. I need the RPi.GPIO
module to make my script run, (even if I don't use it). After calling pip3 install RPi.GPIO
I get following error:
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.5/include/python3.5m -c source/py_gpio.c -o build/temp.macosx-10.6-intel-3.5/source/py_gpio.o
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: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: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())
~~~~~~^
source/py_gpio.c:581:32: warning: comparison of integers of different signs: 'const int' and 'unsigned int' [-Wsign-compare]
if (*(*pin_to_gpio+chan) == gpio)
~~~~~~~~~~~~~~~~~~~~ ^ ~~~~
3 warnings and 5 errors generated.
error: command '/usr/bin/clang' failed with exit status 1
----------------------------------------
Command "/Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/private/var/folders/qv/z3csxhdd66qf95wp51zd3vrh0000gn/T/pip-build-_64gsisl/RPi.GPIO/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/qv/z3csxhdd66qf95wp51zd3vrh0000gn/T/pip-gdjkt_6z-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/qv/z3csxhdd66qf95wp51zd3vrh0000gn/T/pip-build-_64gsisl/RPi.GPIO/
I've tried to install it by hand with similar result. What do I need to make this work?
implicit declaration
implies there's a header missing, meaning it is a missing C library. Dunno what RPi.GPIO is built on, but again, the chances of getting it to compile on OSX are slim to (most likely) none. It will certainly never run.