include is no template!

Error (active) E0864 include is not a template

I just thought you guys should know :)
One of 'those' error messages that new c++ folks love so much, first time I have seen this one, and not 100% sure what I did to confuse it this much.

#include <fstream>
Last edited on
I added #include <fstream> to a project's include list in VS 2019 (16.9.3) and didn't receive that error. *shrug*

That does look like one perverse error message, no matter what.

I'm not doubting you did get that message, just wondering what your compiler is.
It must either be Visual Studio or Visual Studio Code that bugged out.
Found this:

Probably could be that a '#' was originally not typed, and then IntelliSense sees this but doesn't refresh properly after fixing the change?
@Ganado, yeah, I've been inundated with similar errors to what's shown at your link from VS 2019 lately. I've noticed that even when a statement is typed correctly sometimes Intellisense goes loopy until I close the project and reopen it. Intellisense has gotten especially trigger-happy with the last couple of updates to VS.

I can be in the midst of typing a statement, Intellisense jumps and flags what I've typed as wrong. Refusing to update even after finishing typing.

Annoying, absolutely, but it is something I've gotten used to, working around it when needed.
vs 2019, the # was there, its just like I typed it. I never did figure out what its problem was, I was having some major configuration problems with a new install, though. I think it was related to that.
@jonnin, you might try doing a repair from the install dialog. I had some problems a while back that were solved with the repair.
Which is yet another reason why I dislike VS. The command line is so much simpler and it doesn't get errors in it!

Of course, it's also less helpful if there are errors in your code...

Edit: Who reported this...and why? Seriously.
Last edited on
yea I fixed it by mimic of a peer's installed / uninstalled bits. I just posted cause it struck me funny, really. But I appreciate the tip. Getting used to the limitations again... I skipped from the original .net or 2008ish to 2019 and find they took out so much... no tenbytes, no assembly in 64 bit, no editing macros (notepad ++ is a better editor now, for shame M$), #ifndefs are broken if stuck using PCH (I am), ... its gone downhill in nearly every way.
[see above message]
Who told you that you can't get errors using a command line, and that errors can't be helpful?
Last edited on
Oops, not quite what I meant. I meant that there's hardly anything that can go wrong with it that's not your fault. For instance, VS is so complicated (for simple people like me) that 8 times out of 10 I will hit the wrong thing when I want to compile, and it deletes stuff, or something like that. Or it does something weird and then I have to figure out how to fix the darn thing.

Did I say that errors aren't helpful? If I did, I didn't mean it, if it weren't for errors my programs would suck.

Oh, ok. I said that "it's also less helpful if there are errors in your code." Meaning the command line.

I don't know why I said that, maybe I was tired or drunk or something (kidding, I haven't been drunk since high school). But it is helpful, especially if you set the -Wall and -Wextra flags.
Topic archived. No new replies allowed.