GregMefford / blinkchain

Nerves project to use Elixir to drive NeoPixels from a Raspberry Pi
MIT License
71 stars 27 forks source link

Failing when doing mix compile #13

Closed digitalbias closed 6 years ago

digitalbias commented 6 years ago

I don't know if this is just related to my system or if it's a more general bug, but I am getting the following error when trying to include neopixel in my mix file:

==> elixir_make
Compiling 1 file (.ex)
Generated elixir_make app
==> nerves_neopixel
cc -c -I"/Users/david.c.mitchell/.asdf/installs/erlang/21.0.2/usr/include" -I/usr/local/opt/openssl/include -I/usr/local/opt/zlib/include -std=gnu99 -DDEBUG -o src/erlcmd.o src/erlcmd.c
cc -c -I"/Users/david.c.mitchell/.asdf/installs/erlang/21.0.2/usr/include" -I/usr/local/opt/openssl/include -I/usr/local/opt/zlib/include -std=gnu99 -DDEBUG -o src/rpi_ws281x.o src/rpi_ws281x.c
cc -c -I"/Users/david.c.mitchell/.asdf/installs/erlang/21.0.2/usr/include" -I/usr/local/opt/openssl/include -I/usr/local/opt/zlib/include -std=gnu99 -DDEBUG -o src/rpi_ws281x/dma.o src/rpi_ws281x/dma.c
cc -c -I"/Users/david.c.mitchell/.asdf/installs/erlang/21.0.2/usr/include" -I/usr/local/opt/openssl/include -I/usr/local/opt/zlib/include -std=gnu99 -DDEBUG -o src/rpi_ws281x/mailbox.o src/rpi_ws281x/mailbox.c
src/rpi_ws281x/mailbox.c:40:10: fatal error: 'sys/sysmacros.h' file not found
#include <sys/sysmacros.h>
         ^~~~~~~~~~~~~~~~~
1 error generated.
make: *** [src/rpi_ws281x/mailbox.o] Error 1
** (Mix) Could not compile with "make" (exit status: 2).
Depending on your OS, make sure to follow these instructions:

  * Mac OS X: You need to have gcc and make installed. Try running the
    commands "gcc --version" and / or "make --version". If these programs
    are not installed, you will be prompted to install them.

  * Linux: You need to have gcc and make installed. If you are using
    Ubuntu or any other Debian-based system, install the packages
    "build-essential". Also install "erlang-dev" package if not
    included in your Erlang/OTP version. If you're on Fedora, run
    "dnf group install 'Development Tools'".

gcc and make are installed, otherwise, there wouldn't be a problem compiling the previous files at the beginning. Any suggestions on where to go next would be helpful. It's been more than 20 years since I did stuff in C so...not a noob, but might as well be.

digitalbias commented 6 years ago

Figured it out.

It was a shoehorn project and I was in a dependency and not in the firmware project when doing the compilation. mix compile from the firmware directory solved the issue.