hzeller / rpi-rgb-led-matrix

Controlling up to three chains of 64x64, 32x32, 16x32 or similar RGB LED displays using Raspberry Pi GPIO
GNU General Public License v2.0
3.71k stars 1.17k forks source link

How to compile own code with root Makefile #401

Closed fightforlife closed 6 years ago

fightforlife commented 7 years ago

Hi there,

I am completely new to this. I successfully connected a 64x32 RGB Matrix to my Pi and all the demos are working. Now I want to start my own simple code. (just one file) I tried the provided example code in the root and the example-api-use directory as test.cc. But it wont compile.

root@DietPi:~/rgb# make test g++ -Wall -O3 -g -L./lib -lrgbmatrix -lrt -lm -lpthread test.cc -o test test.cc:2:24: fatal error: led-matrix.h: No such file or directory

include "led-matrix.h"

                    ^

compilation terminated.

: recipe for target 'test' failed make: *** [test] Error 1 I dont know how Makefiles work, but they seem only to compile with the provided files. Which is the easiest command to compile my own test.cc with your library? Thanks!
hzeller commented 7 years ago

The README in the examples-api-use shows how you can use the library in your own projects https://github.com/hzeller/rpi-rgb-led-matrix/tree/master/examples-api-use#integrating-in-your-own-application