It looks to me like the read method does not return a value? (ie, returns void) So it's an error that you are testing the value as if it returned a bool.
Hello, Welcome to the Arduino Forum. This guide explains how to get the best out of this forum. Please read and follow the instructions below. Being new here you might think this is having rules for the sake of rules, but that is not the case. If you don’t follow the guidelines all that happens is there is a long exchange of posts while we try to get you to tell us what we need in order to help you, which is frustrating for you and frustrating for us. The people who try to help with your project.
It will help you get the very best out of the forum in the future.
Mention if you are using AI generated code it is important information.
Your OS and version can be valuable information, please include it along with extra security you are using. Antivirus etc.
Always list the version of the IDE you are using and the board version if applicable.
Use quote or CODE tags to add error messages as an attachment NOT a picture.
There are a couple versions of the RF24 library. One has the read() method that returns a bool, the other returns nothing (void). Use the examples that come with the library that you have installed.