When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
1 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
I'm having the same problem again in the same project due to use of a ```cpp
std::ofstream
I believe this system to be from ```cpp
#include <fstream>
```however it claims it is unused and asks for its removal. Removing the include immediately marks all mentions of it with errors, again proving Visual Studio *should* understand the file is necessary.
hm consider unused includes INSIDE the main one?
like are your libraries malformed?
Show us OtherFile.h, who knows what you did there exactly.
Also did you create an empty project or C++ console project?
It's an empty project to start, and the best part is that it is completely unrelated to what I put in the other file, I've stripped it down to just
OtherFile.h
#pragma once
namespace OtherFile
{
void main();
};
OtherFile.cpp
#include "OtherFile.h"
namespace OtherFile
{
void main()
{
}
}
and it still throws the same info.
It seems to be down to the fact the function is called main, changing the name unfortunately removes the info. :/
However the error still occurs with the fstream inclusion which does not have such an easy fix.
One would think that VS would be smart enough to tell the difference between
main();
```and```cpp
OtherFile::main();
dont write the pragma once or something?
well in teh header file you have to, in C++ files nope
You should also start with Console project or Classical Window App project
yeah lol
Empty Project is something that you have to set up by yourself
doable, but why exactly would you?
Why wouldn't I?
Well if you want then go ahead, I don't think you will gain much by it though.
The point was kinda to lose much by it.
This question is being automatically marked as stale.
If your question has been answered, type !solved.
If your question is not answered feel free to bump the post or re-ask.
Take a look at !howto ask for tips on improving your question.
<@undefined>
Please don't delete forum posts. They can be helpful to refer to later and other members can learn from them. In the future you can use !solved to close a post and mark a post as solved.
!solved