Visual Studio 2019: Debugger shows incomplete vector variable information - c++

The issue
Working in C++, VS 2019 Professional 16.0.4.
Whilst in debug, when hovering over a variable you usually get a tool-tip, which is expandable for vectors showing their contents.
In my case this tool-tip is not expandable.
Also, the bigger problem is that adding the specified variable to watch or using the quick watch/Locals/Autos windows, I see missing elements in the expanded vector:
Using the immediate window to see variable contents works fine, but it is a bit cumbersome.
What I tried:
Tried deleting the .vs folder, with no luck.
Trying to reproduce in a small console application does not work.
Tried to update, Installer says it's the latest version of VS.
"Repair VS installation"
Clean & Rebuild
Do you have any suggestions?

Related

(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.

VS2015: Error List doesn't get cleared on new build

There are more than one C++ projects in a solution. Lets compile A, which will fail, and will have errors reported in Error List view. Now compile B (assume A is dependent on B), which will succeed. But, the errors rendered by compiling A doesn't go away.
Anyone encountered such issue? How to enable clearing the error-list view on each build (the way it is working for years). The Output window, however is clean on each new build.
Do you have 'Build Only' or 'Build + Intellisense' selected in the combo box? Many of my errors like this actually come from Intellisense (and tend to be bogus).
I currently have a similar problem with VS2015. I have a solution with c++ and c# wpf projects. Clean checkout, full build, no errors in Output but hundreds of errors appear in Error List. It reminds me of problems with earlier versions of VS back than the only fix was to close all open files but this time this is not helping either. In my case deleting the .suo file helped. See this for reference VS freaks out.
(edit) I read that Xamarin could cause the problem but uninstalling it and also uninstalling all the other addons delivered with VS2015 did not fix the problem. After a clean checkout and full build I got all the errors again.
On Visual Studio 2019, simply closing and restarting the application got rid of the warnings.

Source code is different from original version?

I'm setting break points in Visual Studio before running the Local Windows Debugger, and they all say this when the debugger is running, with a small warning label on each break point. I can't see why this would be happening; people have talked about using different versions of Visual Studio and getting this error, but I made this project earlier today, pasting the base code from my professor into a new project created on my copy of Visual Studio 2012.
I found this when trying to fix a strange error in my program that wouldn't go away even though I manually fixed things (it was a string error that claimed I was using an index outside the bounds of the string; setting this value to 0 explicitly did not fix it) so I presume that this is the actual culprit.
Make sure you're properly building the code (Build Solution or Rebuild Solution).
In the output panel you should now be able to locate where the binaries are located.
Make sure you're debugging the said binaries by looking in the Debugging page of your project properties, the Command property should most likely be set at $(TargetPath).
Other things to look for. The project should be "Set as startup project", the program database option should be activated (by default). Don't modify the source after you started debugging.

Visual Studio 2013 C++ variable watch does not work

I found a thread of another user on another website with the same problem except he is using Fortran while I am using C++:
https://software.intel.com/en-us/forums/topic/508718
In fact, I can cite her/him:
The problem:
My problem is that in the debug mode the program algorithm works fine except it does not show the values of the variables.
I tried the watch window and also moving mouse over the variable but neither of them works.
I tried very simple codes like Hello World and just defined an integer but the program is unable to show the value of the variable in debug mode.
From time to time the debug mode works correctly. Sometimes I have to restart the debugger 10 times and then it works for 1 time. It does not matter whether I add or remove breakpoints.
My setup:
Windows 7 64 Bit
Visual Studio Ultimate 2013 (from MSDNAA, all original stuff) Version 12.0.30501.00 Update 2.
I have another notebook with Windows 7 64 Bit and the same Visual Studio Version installed -> same problem!
I have the same problem once in a while and the following steps help me solving it:
Make sure optimizations are deactivated in your Debug build. If they are enabled you compiler removes stack frames, puts variable values into cpu registers or inlines whole functions. The debugger does not like optimizations.
Make sure you use a Debug Runtime Library (check 'Runtime Library' in 'Code generation' and select Multithreaded-Debug or Multithreaded-Debug-DLL)
Rebuild your application (right click Project -> "Rebuild"). Sometimes there are problems which can be solved by a rebuild (i.e. when you update source files from repository which are older then your binaries but newer then the source you built the binaries from; or when you update your compiler or libraries and only parts of your application are rebuild).
Disable Minimal Rebuild in 'code generation' option page. It may mess up you program database.
If everything fails you may try to create a clean new project with default settings and add all your existing .cpp/.h files. This way you make sure your settings are not messed up.
If you are using global variables defined within a namespace you always have to enter the namespace into the watch window (i.e. a variable 'x' defined in namespace 'Y' must be watched as 'Y::x')
Use getchar(); at the end of the program or at the end of a cout statement. In my experience, I had to use getchar(); multiple times to show the variables and the solution. Try it!

How to make a c++ project run on a different PCs

I developed a small c++ program in Visual Studio 2012 on Windows7, 64bit (let's call it PC1). On that pc it runs fine!
Since I didn't have a versioning control system like SVN at hand, I copied ALL the project data (the exact folder structure, DLLs, source files, project files...) to a usb stick and moved it to another computer.
On that other engine there's Visual Studio 2010 on Windows7, 64bit (PC2).
So I just changed the platform toolset to v100 as described here.
I successfully compiled the project on PC2 (clean, build) and wanted to run the exe, but the command prompt stayed empty.
I then tried to debug and added a breakpoint at the very first line of main - which wasn't reached, the command prompt was still empty.
Ok, a usb stick is certainly not the most secure solution for data storage, so I gave it another try and moved it again - the problem remains.
Visual Studio's output on PC2 is the same as on PC1, so I couldn't find any anomalies there.
Yeah, there might be many error sources, so where can I start?
And how can I get a more verbose output for troubleshooting?
Or is this even a common phenomenon (perhaps due to different VS versions) and there's an simple way fix it?
This is not a full solution, but at least I'm a tiny step ahead:
In my last comment I wrote:
I took your advices into account and created a brand new project on PC2, VS2010. I exactly followed this guide: http://frozenhamster.wordpress.com/2011/02/11/lapack-on-windows-with-visual-studion-2010/
That didn't work either, so I removed I "out-commented" everything except for a single cout. Voila, that worked!
But as soon as I make use of the desired Armadillo (LAPACK and BLAS), the project compils but does not run.
What's going wrong here?
I don't get any compiler errors!