Undefined reference to analogread

Hi, I'm making this code just to test some stuff, but I just get this weird error

void setup() {
	Serial.begin(9600);
}

void loop() {
  	int val = analogRead(0);
	Serial.println(val);   
	delay(100);
}
Arduino: 1.8.7 (Windows 10), Placa:"Arduino/Genuino Uno"

C:\Users\zara\AppData\Local\Temp\cclcKXbb.ltrans0.ltrans.o: In function `loop':

C:\Users\zara\Documents\Arduino\sketch_oct31a/sketch_oct31a.ino:6: undefined reference to `analogRead'

collect2.exe: error: ld returned 1 exit status

exit status 1

Please do this:

  • File > Preferences > Show verbose output during: > compilation (check) > OK
  • Sketch > Verify/Compile
  • After the compilation fails you'll see a button on the right side of the orange bar "Copy error messages". Click that button.
  • Paste the error messages in a reply here using code tags.