Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm running Visual Studio Enterprise 2015, version 14.0.23107.0 D14REL.

When debugging a C++ program I cannot see the contents of STL containers.

I've got the "Show raw structure of objects in variables windows" option unchecked (Tools->Options->Debugging->General).

Here's an example that illustrates the problem:

#include <list>
#include <string>
#include <vector>

int main()
{
    std::string string = "test";
    std::vector<int> vector{ 4, 5, 6 };
    std::list<std::string> list{ "one", "two", "three" };
    return 0;
}

In the Locals or Watch windows I see the following:

list         [...]()
vector       [...](...
  (error)    0
  (error)    0
string       {npos=4294967295}
  (error)    0
  (error)    0

If I then check the "Show raw structure..." option, I can correctly drill down into the vector and string objects, but still not the list!

Is there another option that I've missed, or is this a genuine bug in VS?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
227 views
Welcome To Ask or Share your Answers For Others

1 Answer

I had a same problem.

You need to go into Tools->Options->Debugging->General and uncheck both "Use Managed Compability Mode" and "Use Native Compability Mode".


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...