Page 1 of 1
Error in code: RGB LED Matrix Cube with 25,000 LEDs
Posted: Thu Nov 07, 2024 5:35 pm
by chintan_vaghela91
Hi,
I am trying to follow the
RGB LED Matrix Cube Guide and am getting an error when I run the following code from the guide
CODE:
Code: Select all
cd
sudo apt-get install -y libjpeg-dev git
git clone --depth 1 https://github.com/adafruit/Adafruit_Learning_System_Guides.git
cd Adafruit_Learning_System_Guides/Pi_Matrix_Cube
make
ERROR:
Code: Select all
globe.cc:66:10: fatal error: led-matrix.h: No such file or directory
66 | #include <led-matrix.h>
| ^~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:13: globe] Error 1
How do I solve this error? Any help is appreciated!
Thanks!
Re: Error in code: RGB LED Matrix Cube with 25,000 LEDs
Posted: Thu Nov 07, 2024 7:35 pm
by dastels
Did the LED-matrix library get installed successfully?
Dave
Re: Error in code: RGB LED Matrix Cube with 25,000 LEDs
Posted: Fri Nov 08, 2024 2:44 am
by chintan_vaghela91
Yes, everything other than this installed alright!
Re: Error in code: RGB LED Matrix Cube with 25,000 LEDs
Posted: Fri Nov 08, 2024 9:23 am
by dastels
Well, the compiler can't find led-matrix.h, which means either it's not installed or isn't in a place the compiler looks. Can you find it on your system?
Dave
Re: Error in code: RGB LED Matrix Cube with 25,000 LEDs
Posted: Fri Nov 08, 2024 2:30 pm
by chintan_vaghela91
I can find the led-matrix.h, but I am not sure where the compiler is looking for it. I tried to copy to the same folder as the script but that didn't seem to help either.
I am using a 64 bit OS, where as the guide suggested to use 32 bit. I am not sure if that's something that's creating an issue. I assume not, but I am not sure.
EDIT: I get the same error on 32 bit Bookworm OS Lite
Re: Error in code: RGB LED Matrix Cube with 25,000 LEDs
Posted: Fri Nov 08, 2024 3:35 pm
by chintan_vaghela91
I get the same error with a 32 bit Legacy Lite OS
Re: Error in code: RGB LED Matrix Cube with 25,000 LEDs
Posted: Fri Nov 08, 2024 6:03 pm
by dastels
Where did you find it?
Dave
Re: Error in code: RGB LED Matrix Cube with 25,000 LEDs
Posted: Fri Nov 08, 2024 6:12 pm
by chintan_vaghela91
It is available in
Code: Select all
~/rpi-rgb-led-matrix/examples-api-use/include
folder.
Re: Error in code: RGB LED Matrix Cube with 25,000 LEDs
Posted: Fri Nov 08, 2024 7:42 pm
by dastels
I doubt the compiler is looking there. You would need that path added to the include path of the compiler.
You could try putting it with the source code (which I think you did) and change the <> to "" in the include directive to have it look locally first.
See
https://learn.microsoft.com/en-us/cpp/p ... w=msvc-170 for an explaination.
Dave
Re: Error in code: RGB LED Matrix Cube with 25,000 LEDs
Posted: Sun Nov 10, 2024 2:30 pm
by chintan_vaghela91
That kind of helped, but now I get a new error when I run make:
Code: Select all
g++ -Wall -Ofast -fomit-frame-pointer -I../rpi-rgb-led-matrix/include globe.cc -o globe -L../rpi-rgb-led-matrix/lib -lrgbmatrix -lrt -lm -lpthread -ljpeg
/usr/bin/ld: cannot find -lrgbmatrix
collect2: error: ld returned 1 exit status
make: *** [Makefile:13: globe] Error 1
P.S. - I also had to copy all of the other header files to the the current directory as well.
Re: Error in code: RGB LED Matrix Cube with 25,000 LEDs
Posted: Sun Nov 10, 2024 3:21 pm
by chintan_vaghela91
I believe I’ve identified the root
ISSUE:
The
Makefile is set up to expect the
Pi_Matrix_Cube directory inside the
rpi-rgb-led-matrix directory. However, the guide's instructions direct you to clone the entire
Adafruit_Learning_System_Guides repository into your default directory,
/home/pi/. This setup causes it to fail to locate the header files and necessary libraries.
SOLUTION:
Updating the following line in the
Makefile from
Code: Select all
RGB_LIB_DISTRIBUTION=../rpi-rgb-led-matrix
to
Code: Select all
RGB_LIB_DISTRIBUTION=/home/pi/rpi-rgb-led-matrix
resolves the issue by providing an absolute path to the header files and libraries.
Implementing this change in the GitHub repository would ensure compatibility for anyone following the guide. It could be worth updating the code for a smoother user experience.
P.S. - I’m still waiting for the RGB Matrix Bonnet to arrive, so I haven’t been able to run the code to confirm it works as expected. I'm pre-configuring my Pi to save time and will update here in a few days once I can test everything fully.
Re: Error in code: RGB LED Matrix Cube with 25,000 LEDs
Posted: Sun Nov 10, 2024 5:42 pm
by dastels
That would do it.
Dave
Re: Error in code: RGB LED Matrix Cube with 25,000 LEDs
Posted: Thu Nov 21, 2024 2:38 am
by chintan_vaghela91
It worked!