recently (VS 2022 17.10&17.11), MSVC has been using “note” messages to detail the context of an error message:
Blockquote
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.39.33519\include\memory(3434,32): error C2259: ‘AbstractClass’: cannot instantiate abstract class
D:\Projects\test\error_messages\main.cpp(3,7): note: see declaration of ‘AbstractClass’
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.39.33519\include\memory(3434,32): note: due to following members:
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.39.33519\include\memory(3434,32): note: ‘void AbstractClass::foo(void)’: is abstract
D:\Projects\test\error_messages\main.cpp(6,18): note: see declaration of ‘AbstractClass::foo’
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.39.33519\include\memory(3434,32): note: the template instantiation context (the oldest one first) is
D:\Projects\test\error_messages\main.cpp(35,20): note: see reference to function template instantiation ‘std::unique_ptr<AbstractClass,std::default_delete> std::make_unique<AbstractClass,0>(void)’ being compiled
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.39.33519\include\memory(3434,35): error C2259: ‘AbstractClass’: cannot instantiate abstract class
D:\Projects\test\error_messages\main.cpp(3,7): note: see declaration of ‘AbstractClass’
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.39.33519\include\memory(3434,35): note: due to following members:
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.39.33519\include\memory(3434,35): note: ‘void AbstractClass::foo(void)’: is abstract
D:\Projects\test\error_messages\main.cpp(6,18): note: see declaration of ‘AbstractClass::foo’
Blockquote
But with cmake, those note messages are filtered out:
Blockquote
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.39.33519\include\memory(3434,32): error C2259: ‘AbstractClass’: cannot instantiate abstract
class [D:\Projects\test\error_messages\out\build\test\HelloWorld.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.39.33519\include\memory(3434,35): error C2259: ‘AbstractClass’: cannot instantiate abstract
class [D:\Projects\test\error_messages\out\build\test\HelloWorld.vcxproj]
is there a way to have cmake preserve those messages?
note: I am using cmake version 3.29.3
Thanks!