'Void' does not name a type

  • Arduino C++

You may see

error: 'Void' does not name a type; did you mean 'void'?
does not name a type

Why it happens

  • A phone or word processor put a capital letter at the start.
  • A command was written outside any function.
  • A library that defines the word isn't included.

How to fix it

  1. Change the word to small letters, as in void, int, float.
  2. If the line is a command, move it inside setup() or loop().
  3. If it's something like Servo or DHT, add its #include line.

It worked if: Verify passes.

Seen in a real run (some lines are close variants of it). Produced with Arduino CLI 1.5.1 and Arduino AVR core 1.8.8 (the same compiler the Arduino IDE uses).

Didn't help? Search another error or ask us.