jeremy-rifkin / cpptrace

Simple, portable, and self-contained stacktrace library for C++11 and newer
MIT License
701 stars 75 forks source link

Having troubles building cpptrace via MSVC\14.38.33130 in Windows. #65

Closed alexbichkov closed 11 months ago

alexbichkov commented 11 months ago

Got build error, tried latest 0.3.1 version and with default cmake options.

2>cpptrace.cpp
2>E:\Projects\cpptrace\src\utils\utils.hpp(422,62): error C2794: 'type': is not a member of any direct or indirect base class of 'std::enable_if<false,int>'
2>(compiling source file '../cpptrace/src/cpptrace.cpp')
2>E:\Projects\cpptrace\src\utils\utils.hpp(368,48): error C2065: 'D': undeclared identifier
2>(compiling source file '../cpptrace/src/cpptrace.cpp')
2>E:\Projects\cpptrace\src\utils\utils.hpp(368,40): error C2672: 'std::declval': no matching overloaded function found
2>(compiling source file '../cpptrace/src/cpptrace.cpp')
2>C:\Software\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\type_traits(131,29):
2>could be '_Add_reference<_Ty,void>::_Rvalue std::declval(void) noexcept'
2>  E:\Projects\cpptrace\src\utils\utils.hpp(368,48):
2>  'std::declval': invalid template argument for '_Ty', type expected
2>E:\Projects\cpptrace\src\utils\utils.hpp(368,66): error C2065: 'T': undeclared identifier
2>(compiling source file '../cpptrace/src/cpptrace.cpp')
2>E:\Projects\cpptrace\src\utils\utils.hpp(368,58): error C2672: 'std::declval': no matching overloaded function found
2>(compiling source file '../cpptrace/src/cpptrace.cpp')
2>C:\Software\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include\type_traits(131,29):
2>could be '_Add_reference<_Ty,void>::_Rvalue std::declval(void) noexcept'
2>  E:\Projects\cpptrace\src\utils\utils.hpp(368,66):
2>  'std::declval': invalid template argument for '_Ty', type expected

Any insight would be appreciated.

jeremy-rifkin commented 11 months ago

Hi @alexbichkov, thanks so much for your interest in the library! There is a bug with the latest version of msvc that will be fixed in the next release of msvc. I'm happy to try to workaround it on the cpptrace side but I have not done so yet.

alexbichkov commented 11 months ago

Thank you for clarifying. Issue is not critical, just gonna try to rollback MSVC a bit. Do you know, what version of msvc is used in your test builds?

jeremy-rifkin commented 11 months ago

Locally it looks like it should build correctly with toolset 14.37 / msvc 19.37. The only affected version as far as I can tell is 14.38 / 19.38. I've only tested with a minimal reproducible example but I think this should be the case for cpptrace as a whole.

I'm going to patch this with a workaround and re-tag 0.3.1.

alexbichkov commented 11 months ago

It's fine now. Thanks for patching.

shrinktofit commented 10 months ago

@jeremy-rifkin Still having trouble at 19.38.33133:

image

Should I wait for updates on MSVC?

jeremy-rifkin commented 10 months ago

Hi @shrinktofit, what version of cpptrace are you using? The patch is included in the v0.3.1 release. Otherwise, the next msvc update should fix it.