Recently I have beng using blynk and Arduino for my projects. I wanted to make a utonomous car which follows me. though I keep getting this error while verifying. ISO C++ forbids comparison between pointer and integer [-fpermissive]
I have a float called Geo Distance which is basically the distance betweeen the car and the phone. Here is the code for the float:
/home/pi/Arduino/car_raspberry_pi/car_raspberry_pi.ino: In function 'void drive(int, float)':
/home/pi/Arduino/car_raspberry_pi/car_raspberry_pi.ino:264:12: warning: ISO C++ forbids comparison between pointer and integer [-fpermissive]
if ( 8 > geoDistance ) {
^~~~~~~~~~~
The weird thing is after showing the error the code compiles so I am not sure if it is working. I am using arduino on my raspberry pi buit the same thing is happening on my laptop.
so, I tried to make my 8 into a decimal like a float but now I am getting a new error
Arduino: 1.8.12 (Linux), Board: "Arduino Uno"
/home/pi/Arduino/car_raspberry_pi/car_raspberry_pi.ino: In function 'void drive(int, float)':
car_raspberry_pi:264:19: error: invalid operands of types 'float(GeoLoc&, GeoLoc&)' and 'double' to binary 'operator<'
if (geoDistance < 8.0 ) {
exit status 1
invalid operands of types 'float(GeoLoc&, GeoLoc&)' and 'double' to binary 'operator<'
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
even after show verbode output during compilation is enabled I get the same error.
I am very confused.
Turns out I made a mistake in my code. Instead of geoDistance over there it was suppose to be distance. Which I had put as an integer in brackets. Sorry for disturbing you all.