j00hi
j00hi

Reputation: 5951

How to view template compiler error details in Visual Studio

I am working with Visual Studio 2015 and I'm getting a lot of compiler errors but I can't figure out where the root cause of those is:

Compiler errors in Visual Studio

Double-clicking on the highlighted error takes me into the list file to the operator==:

template<class _Ty,
class _Alloc> inline
bool operator==(const list<_Ty, _Alloc>& _Left,
    const list<_Ty, _Alloc>& _Right)
{   // test for list equality
return (_Left.size() == _Right.size()
    && _STD equal(_Left.begin(), _Left.end(), _Right.begin()));
}

Well, that doesn't help. Since I am working on a huge project, I don't know where the root cause of that error is, i.e. where is the code which uses the std::list in a way that causes this error?

I think XCode shows a stack for such errors, if I remember correctly.
How can I find out where this error originates?

Upvotes: 5

Views: 2686

Answers (1)

Phil
Phil

Reputation: 6184

As discussed in the comments, the Output tab (Ctrl+Alt+O) shows all the messages from the compiler. The Error List tab just shows one message, the actual error, which, as you said, for template compilation problems is not very helpful. What I have found works rather well (it is a little tedious, but it does work), is to

  1. Double click on the message in the Error List tab.
  2. Switch to the Output tab
  3. Step to next message in the chain using F8 (shift-F8 steps to previous message)

Upvotes: 7

Related Questions