简体   繁体   中英

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:

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, ie 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?

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM