VS2013 Info:
Microsoft Visual Studio Professional 2013 Version 12.0.30723.00 Update 3 Microsoft .NET Framework Version 4.5.51209
So here is what is going on. I installed VS2013 the the other day just to see what kind of improvements have been made and was pleasantly surprised and happy with the changes to the C++ environment. However once I started writing code in it and debugging I found a major issue with VS2013's watch window.
For whatever reason almost no variables can be examined in the watch window in any of the tabs. Most of the time the Autos tab is empty and in the Watch tabs nearly any variable I slap in there gets reported as being out of scope with the current break point.
For example take this small for statement and a few lines before it:
cout << "Number of ship classes: " << sCTypes << endl << endl;
cout << sIDS.size() << endl;
for (i1 = 0; i1 < sIDS.size(); i1++)
{
cout << sClasses.at(i1) << " ID Range: Low: " << sIDS.at(i1).vRange.iLow << "| High: " << sIDS.at(i1).vRange.iHigh << endl;
}
The break point is placed on the start of the for loop definition but my watch entry:
sIDS.size()
comes up as identifier "sIDS" is undefined even after several attempts to refresh the cell in the watch window.
So far the only things the watch window (any tab) will process are function parameters. Anything like a class or struct member it acts as if it is not even there.
This only seems to be effecting this particular project. If I start a new one things work as they are supposed to. The code comes from VS2012 but I just copied the headers/cpp files over and added them as existing files to the project, no converting from a 2012 project to 2013.
I will add a link to my entire project in case someone wants to download it and try and figure this out: http://www.lmpgames.com/ov_0.6a_new.zip
Here is the full code for the area in question above and where that particular function is called from:
globalVars.cpp:
void printData()
{
//TODO: Raname variable labels to ini file keys instead
//Ship ID Ranges By Class
cout << "Format: Description: name of low entry from scSettings.ini: imported value |" << endl;
cout << "name of high entry from scSettings.ini: imported value" << endl << endl;
cout << "Number of ship classes: " << sCTypes << endl << endl;
//cout << ssIDS.size() << endl;
cout << "Starter Ship ID Range: Low: " << ssIDS.iLow << "| High: " << ssIDS.iHigh << endl;
system("Pause");
system("CLS");
cout << sIDS.size() << endl;
for (i1 = 0; i1 < sIDS.size(); i1++)
{
cout << sClasses.at(i1) << " ID Range: Low: " << sIDS.at(i1).vRange.iLow << "| High: " << sIDS.at(i1).vRange.iHigh << endl;
}
system("Pause");
system("CLS");
cout << "Class names imported:" << endl;
for (i1 = 0; i1 < sClasses.size(); i1++)
{
cout << sClasses.at(i1) << endl;
}
system("Pause");
system("CLS");
}
main.cpp:
int main()
{
srand( time(0) );
int pChoice;
int gSRows;
int pID;
int sID;
char pCChoice;
bool gQuit;
bool gMMenu = true;
bool bErrors;
bool lStation;
bool locked = false; //Use this to lock the main menu from the player during certain events such as using a clone
string eResult; //Event result; used for any time a loop is done where multiple outcomes, more than two, can be achieved
//Get data from configuration file
gv::getCData();
gv::printData();
...
return 0;
}
Figured out what I was doing wrong. You have to access these kinds of variables with the namepsace in the watch window or else it cannot find the symbols. Adding a gVars:: in front of sIDS.size() did the trick.