Robin2:
Maybe there should also be a #include for the .c files?
That might actually work, as long as you only put the #include in one spot in one .ino file, and not in a header.
The #include directive is just a text insertion. It basically says "Take the text of this file, and put it in this spot before sending this off to the compiler". There is nothing restricting #include to work only with .h files, it can be used with any text file.
All of this is because the Arduino IDE copies your code to another location before it tries to compile it so all references are relative to the place where the Arduino IDE has copied the code.
This isn't really an Arduino-specific issue. No matter what IDE or toolchain you use, it needs to know what files to send to the compiler. Whether that's tracked in a manually curated makefile or your IDE keeps track of them in a project file, you need those files listed somewhere. In most IDEs you can add references to external files in your project file so it can add them to the makefile it generates, but that still requires you to tell the IDE about those external source files. If you just #include random headers without adding a reference to their corresponding source files, your project won't build properly. I've used about 3 different C++ IDEs to make small desktop programs (Qt, Bloodshed Dev-C++, and Falcon C++), and they've all worked roughly the same way.
The Arduino IDE doesn't let you add references to external files, so you have to either put the source files in a place that the Arduino IDE looks for them (the libraries folder or the sketch folder), or #include the .c and .cpp files too.
I've done this before when I wanted to rewrite the whole structure of a small program I've written, but didn't want to get rid of the old one just yet and didn't want to create a separate project directory for it. The old main.cpp file becomes main_old.cpp, and I make a main_new.cpp that contains the new program. This in main.cpp I do this:
//#define __OLD
#ifdef __OLD
#include "main_old.cpp"
#else
#include "main_new.cpp"
#endif
That made it easy to change between the old and new behavior by just commenting or uncommenting the #define line and recompiling.
Maybe if all the files are put into the same directory as the .ino file things will work?
...R
That works too.