Visual Studio stopped recognizing any include files - c++

So, I was randomly working on my project and visual studio 2017 was recognizing all my OpenCV stuff just fine, but randomly all of a sudden, it stopped recognizing it right while I was in the middle of coding it, there's errors all over the place saying that functions from OpenCV are undefined and that the source files cannot be opened, this literally makes no sense as it was just working and I had gotten stuff to compile and then all of a sudden in the middle of coding, it just will refuse to recognize anything, I'm really confused and I checked the include and library files and everything was just the same as it was when I had started out, I think something might be wrong with Visual Studio, but I have no idea what to do. I even tried restarting my computer to see if that fixed it, but I'm still stuck in the same boat :/
Edit: Interesting note, when I go to access the project properties, it no longer says properties, it just says properties, could it be a corrupt project?

Okay, so Richard Critten's suggestion of doing a chkdsk /f worked, I rebooted to have it check my main disk and now it oddly requires me to specify a folder in the include directory which I didn't have to do before which is odd, but now it's finally working and recognizing everything as it should. Thanks for the help, I just had never seen it before do that while in the middle of a project randomly which severely confused me.

Related

why have my c++ compilers disappeard from vscode?

I was trying to write a c++ program, but when i went to compile it all my compilers had disappeared from the menu. I know theyre installed as ive used them before, but for some reason they arent showing up in vscode. The only thing thats showing up now is "cl.exe" before i also had the option of g++ and nothing has changed with the system so im very confused as to why this is.
I've tried restarting my computer, restarting vscode, checking if my compilers have somehow uninstalled themselves, but they all seem to be there. So i dont know why theyre missing.

Intellisense stops working after modifying includes

Good evening all,
I currently have a source which behaves very unusually and I am completely stumped as to why.
The issue:
When initially opening the source, the project includes and libraries are broken
This path does not exist
However, when I attempt to amend this issue by removing the broken directories, Intellisense stops working. This is obviously a problem because Intellisense is pog. Stops working after path change
I have never seen this before and I have spent quite a while try to fix it but with no success, here are some of the things I have tried:
Including the rest of the DX9 files I needed
Trying Visual Studio 17, 19, and 22
Updating SDK and VS to latest versions
Resetting VS preferences
Also, Yes it is turned on, it breaks as soon as I change anything
I hope someone knows how to fix this thx
Edit: Here is a gif showing it in action: https://i.imgur.com/l4JsxN3.gif

Visual Studio cannot start debugging for C++ project 0x80070057

Randomly (and infrequently), Visual Studio (2017) will abruptly refuse to run my C++ project. This will suddenly start happening in the middle of a session.
Visual Studio will still build the project and generate the executable, however, the following cryptic error message appears every time I want to run my program. No changes were made to the configuration or project and it strangely happens after an innocent build.
(It goes without saying but I tried extensively checking for solutions to this problem and no solution worked or was applicable)
Whether I add a new configuration setting or play with the existing settings (Release/Debug, x86/x64), nothing fixes it except performing a full repair (and that takes a very long time). Creating a new project didn't help either, but running it in VS 2015 is successful.
This happens approximately once a week, so I would greatly appreciate knowing how this error can be fixed (or at least avoided).
After some more experience with it, it appears just to be an issue with Visual Studio when builds are too large and executed too often (it happened to multiple computers). More specifically, it could come about as a result of using many templates and applying a large number of explicit template specializations. By building with only the template specializations I need for testing, the issue doesn't come up.
This is usually caused by VS mixing release and debug binaries for me. I have a script which cleans all the output directories, including the garbage VS puts into the projects .vs and Windows Temp folder. This always fixes the issue for me.

(VS2017) Randomly losing reference and intelliscense

I am currently facing a weird problem with visual studio 2017 community edition.
It randomly lose all reference in the "reference tab" and the intellisense stop work at all.
It is only at design time, even with tons of "false errors" in the error window, if you compile and run, it will work just fine.
I was looking over some similar problems and one solution said to remove one tag from the .projec file.
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
I did it, at first time it worked, but after while, it randomly stopped working again. I went back to the file but that particular tag wasn't there.
The weird part is that when it happens, if I go to the reference window, it have all namespaces unselected. if I select any namespace, it throws me an error and select all corretc namespaces at same time.
After selecting the namespace, when I save the project I get this error.
If I close everything and open again, it is working just fine, until randomly stop working again.
I have tried other solutions as well but it always back to the same scenario.
It started happening after I had to delete the folder "C:\Users\xxxxxx\AppData\Local\Microsoft\VisualStudio".
I had to delete that folder because it freeze every single time I tried to open any project, the only solution that solve was deleting that particular folder.
After that the all projects open just fine, but I need to select the reference again and that when the problem starts.
It is a new project made in the current version of the visual studio, not a migration.
As suggested by #Sara Liu, I will mark
updating the visual studio to a version >= 15.5.5
As an answer to the problem.

Trying to right click on code in VS2008 causes lockup

Working on a Win32 DLL using Visual Studio 2008 SP1 and, since yesterday, whenever I try to right click on code, to go to a variable definition for example, VS completely locks up and I have to manually kill the process. To make it even weirder, whenever this happens the devenv.exe process uses exactly 25% of the CPU. And I mean exactly, never 24%, never 26%, always 25%
Also, I've run ProcMon to see if devenv is actually doing something, but it's doing absolutely nothing external of the process. No disk, network, registry access. Nothing.
This is getting really aggravating because I have a large code base to deal with and the only other way of jumping to the definition is to first search for it.
Has anyone run into a similar issue? And, better yet, know a fix?
Edit: More info. Other projects (even an older version of the same one) work fine. I diffed the project file and the only differences is added source files and a /D define in the command line params.
Edit 2: So, it seems that now it's actually because intellisense is stuck updating. For some reason the status bar was disabled, but when getting it back I say "Updating Intellisense... (186)" and from what I've read, that 186 means that there are 186 background threads working. 186?! But, procmon still shows no IO whatsoever.
Try deleting all .sbr .bsc and .pdb files.
For the 25% CPU load: I guess it uses one core on your quad core machine.
If you have Visual Assist installed, try disabling it.
On connect, a submitted bug: Visual Studio Hang, seems to closely resemble your issue:
At random times, when I right click in the text editor, in this case C/C++ editor, Visual Studio will just hang. And if I wait it out, it still hangs.
It seems the workaround is to exit Visual Studio and delete the intellisense (.ncb) file in your project directory and reopen it.
The issue you are seeing is an intermittent failure in prior versions of Visual C++ that is hard to diagnose, and has a relatively simple workaround, as you have discussed, which is to delete your NCB. In order to get proper intellisense for header files, they would need to be included by a .cpp file in your project (directly, or indirectly through another header.)