A very confusing error just now:
error: aggregate ‘std::ofstream out’ has incomplete type and cannot be defined
from simple code:
And the similar one:
error: variable ‘std::ofstream out’ has initialiser but incomplete type
from this code:
Using this didn't help:
Using this also didn't help:
That was confusing me most, but now I see I've been getting "error: ofstream: No such file or directory" and I was missing it in the noise of other warnings and errors.
The solution was simple:
Yes, a very simple solution, but google wasn't helping. If it had been saying "ofstream is not a member of std" I'd have known I was missing a header file; a strange error message has you looking in other places. (I guess another std header file is doing a forward declaration for ofstream, which is why we get "incomplete type".)
Mumble, grumble, back to work.