rpi-rgb-led-matrix icon indicating copy to clipboard operation
rpi-rgb-led-matrix copied to clipboard

i cant compile my c++ program with the api

Open hannescam opened this issue 3 years ago • 0 comments

hello, i want to make a timer with the c++ api of this project the code: `#include "led-matrix.h"

using rgb_matrix::RGBMatrix;

int main(int argc, char **argv) { RGBMatrix::Options my_defaults; my_defaults.hardware_mapping = "regular"; my_defaults.chain_length = 1; my_defaults.cols = 64; my_defaults.rows = 64; my_defaults.show_refresh_rate = true; rgb_matrix::RuntimeOptions runtime_defaults; runtime_defaults.drop_privileges = 1; RGBMatrix *matrix = RGBMatrix::CreateFromFlags(&argc, &argv, &my_defaults, &runtime_defaults); if (matrix == NULL) { PrintMatrixFlags(stderr, my_defaults, runtime_defaults); return 1; } delete matrix; }`

could anyone help me thankyou

the command to compile: pi@led-panel:~/rpi-rgb-led-matrix/include $ g++ test.cpp -o test

the error: /usr/bin/ld: /tmp/ccPlx9WR.o: in function main': test.cpp:(.text+0x14): undefined reference to rgb_matrix::RGBMatrix::Options::Options()' /usr/bin/ld: test.cpp:(.text+0x48): undefined reference to rgb_matrix::RuntimeOptions::RuntimeOptions()' /usr/bin/ld: test.cpp:(.text+0x68): undefined reference to rgb_matrix::RGBMatrix::CreateFromFlags(int*, char***, rgb_matrix::RGBMatrix::Options*, rgb_matrix::RuntimeOptions*, bool)' /usr/bin/ld: test.cpp:(.text+0x90): undefined reference to `rgb_matrix::PrintMatrixFlags(_IO_FILE*, rgb_matrix::RGBMatrix::Options const&, rgb_matrix::RuntimeOptions const&)' collect2: error: ld returned 1 exit status

and i am on a pi3 b+ with 64 bit raspbian and all examples work

hannescam avatar Sep 22 '22 09:09 hannescam