Visual C++ (VS 17.10.4) don't show template errors

Никольский Данил 0 Reputation points
2024-07-20T15:44:40.9566667+00:00

After updating to the latest version of the studio, error output stopped appearing when compiling templates. That in a project with several thousand files makes work almost impossible.

What do I see now:

1>SHEngineTools.cpp
1>X:\GitHub\ixray-1.6-stcop\src\xrCore\xrMemory_subst_msvc.h(14,20): error C2665: "CConstant::CConstant": ни одна перегруженная функция не может преобразовать все типы аргументов
1>Сборка проекта "ShaderEditor.vcxproj" завершена с ошибкой.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,174 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,754 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Arpit Verma 0 Reputation points
    2024-07-22T13:52:16.0266667+00:00

    Visual Studio 2017 (version 17.10.4) has a known issue where template error messages are not displayed correctly. This issue is being tracked by Microsoft and has been fixed in later versions of Visual Studio.

    To work around this issue in Visual Studio 2017, try the following:

    1. Enable "Diagnostic mode" in the Output window:
      • Go to Tools > Options > Projects and Solutions > Build and Run.
      • Under "MSBuild project build output verbosity", select "Diagnostic".
    2. Increase the "Template Depth" limit:
      • Go to Tools > Options > Text Editor > C/C++ > Advanced.
      • Under "Template Depth", increase the value (e.g., to 1000).
    3. Use the "/Wall" compiler option to show all warnings and errors:
      • Go to Project > Properties > Configuration Properties > C/C++ > Command Line.
      • Add "/Wall" to the "Additional Options" field.

    If these workarounds don't help, consider upgrading to a later version of Visual Studio, such as Visual Studio 2019 or Visual Studio 2022, which have improved template error reporting.


  2. Tianyu Sun-MSFT 31,006 Reputation points Microsoft Vendor
    2024-07-25T09:00:39.6866667+00:00

    Hi @Никольский Данил,

    Try "Normal" maybe, instead of "Detailed"(Tools > Options > Projects and Solutions > Build And Run > "MSBuild project build output verbosity:").

    Some detailed error messages may be hidden if you choose "Minimal", so you only see the high-importance messages.

    Kindly check this document for more details: To change the amount of information included in the build log.

    Though above option changes the amount of information included in the build log, it should not be changed automatically after you update Visual Studio.

    If you still remember the version of VS which worked before, I would be happy to test on my side by using that version of VS 2022 and confirm the issue.

    Sincerely,

    Tianyu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.