adding a file without adding a tab

Just adding to what pert said.

To my simpleton way of thinking, it's each "thing" that is treated as a single unit by the compiler. So, in an Arduino project, you'd have separate translation units for:

  • The .ino file after the Arduino IDE has done its thing
  • The hidden main.cpp
  • Each additional .cpp file that's part of the project
  • Source code for Arduino core features being used
  • Source code file for each library that's used

There could be others, I'm not that great of a tool-chain guy.

After each unit is compiled to produce individual object code files, the linker stitches them all together into an executable. That's what will puke when it finds multiple function / variable definitions caused by putting those definitions in .h files.