3 ms·
I get errors when I try to compile it on my system. $ g++ -v gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC) $ g++ -c backward.cpp In file included
by montecarl 14y ago
I get errors when I try to compile it on my system.
$ g++ -v
gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC)
$ g++ -c backward.cpp
In file included from backward.cpp:26:
backward.hpp: In member function ‘_Unwind_Reason_Code backward::details::Unwinder<F>::backtrace(_Unwind_Context*)’:
backward.hpp:595: error: there are no arguments to ‘_Unwind_GetIPInfo’ that depend on a template parameter, so a declaration of ‘_Unwind_GetIPInfo’ must be available
backward.hpp:595: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
backward.hpp: In member function ‘_Unwind_Reason_Code backward::details::Unwinder<F>::backtrace(_Unwind_Context*) [with F = backward::StackTraceImpl<backward::system_tag::linux_tag>::callback]’:
backward.hpp:587: instantiated from ‘static _Unwind_Reason_Code backward::details::Unwinder<F>::backtrace_trampoline(_Unwind_Context*, void*) [with F = backward::StackTraceImpl<backward::system_tag::linux_tag>::callback]’
backward.hpp:576: instantiated from ‘size_t backward::details::Unwinder<F>::operator()(F&, size_t) [with F = backward::StackTraceImpl<backward::system_tag::linux_tag>::callback]’
backward.hpp:612: instantiated from ‘size_t backward::details::unwind(F, size_t) [with F = backward::StackTraceImpl<backward::system_tag::linux_tag>::callback]’
backward.hpp:628: instantiated from here
backward.hpp:595: error: ‘_Unwind_GetIPInfo’ was not declared in this scope
- bombela 14y agoHey, I am not the OP, but the author of the code. So it seems that the function is not always declared in some header, while it exists in libgcc. Can you add an issue on github? Meanwhile, you can set the #define BACKWARD_HAS_BACKTRACE=1 which will disable the use of "unwind". You will get slightly less accurate stack trace (especially on CPU exception and other signals), but it should work ok until this bug is fixed.
- prg318 14y agoHi there, I've also run into this issue. I've opened an issue on your github: https://github.com/bombela/backward-cpp/issues/2 https://github.com/bombela/backward-cpp/issues/2 Thanks again for the really useful open source contribution! I will be integrating this with my C++ projects.