Error in code: RGB LED Matrix Cube with 25,000 LEDs

Report issues with the Adafruit Playground editor and display here.
(This forum is not for Circuit Playground board issues.)

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Post Reply
User avatar
chintan_vaghela91
 
Posts: 8
Joined: Thu Nov 07, 2024 5:23 pm

Error in code: RGB LED Matrix Cube with 25,000 LEDs

Post 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!

User avatar
dastels
 
Posts: 17024
Joined: Tue Oct 20, 2015 3:22 pm

Re: Error in code: RGB LED Matrix Cube with 25,000 LEDs

Post by dastels »

Did the LED-matrix library get installed successfully?

Dave

User avatar
chintan_vaghela91
 
Posts: 8
Joined: Thu Nov 07, 2024 5:23 pm

Re: Error in code: RGB LED Matrix Cube with 25,000 LEDs

Post by chintan_vaghela91 »

Yes, everything other than this installed alright!

User avatar
dastels
 
Posts: 17024
Joined: Tue Oct 20, 2015 3:22 pm

Re: Error in code: RGB LED Matrix Cube with 25,000 LEDs

Post 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

User avatar
chintan_vaghela91
 
Posts: 8
Joined: Thu Nov 07, 2024 5:23 pm

Re: Error in code: RGB LED Matrix Cube with 25,000 LEDs

Post 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

User avatar
chintan_vaghela91
 
Posts: 8
Joined: Thu Nov 07, 2024 5:23 pm

Re: Error in code: RGB LED Matrix Cube with 25,000 LEDs

Post by chintan_vaghela91 »

I get the same error with a 32 bit Legacy Lite OS

User avatar
dastels
 
Posts: 17024
Joined: Tue Oct 20, 2015 3:22 pm

Re: Error in code: RGB LED Matrix Cube with 25,000 LEDs

Post by dastels »

Where did you find it?

Dave

User avatar
chintan_vaghela91
 
Posts: 8
Joined: Thu Nov 07, 2024 5:23 pm

Re: Error in code: RGB LED Matrix Cube with 25,000 LEDs

Post by chintan_vaghela91 »

It is available in

Code: Select all

~/rpi-rgb-led-matrix/examples-api-use/include
folder.

User avatar
dastels
 
Posts: 17024
Joined: Tue Oct 20, 2015 3:22 pm

Re: Error in code: RGB LED Matrix Cube with 25,000 LEDs

Post 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

User avatar
chintan_vaghela91
 
Posts: 8
Joined: Thu Nov 07, 2024 5:23 pm

Re: Error in code: RGB LED Matrix Cube with 25,000 LEDs

Post 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.

User avatar
chintan_vaghela91
 
Posts: 8
Joined: Thu Nov 07, 2024 5:23 pm

Re: Error in code: RGB LED Matrix Cube with 25,000 LEDs

Post 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.

User avatar
dastels
 
Posts: 17024
Joined: Tue Oct 20, 2015 3:22 pm

Re: Error in code: RGB LED Matrix Cube with 25,000 LEDs

Post by dastels »

That would do it.

Dave

User avatar
chintan_vaghela91
 
Posts: 8
Joined: Thu Nov 07, 2024 5:23 pm

Re: Error in code: RGB LED Matrix Cube with 25,000 LEDs

Post by chintan_vaghela91 »

It worked!

Post Reply
Please be positive and constructive with your questions and comments.

Return to “Issues with the Adafruit Playground”