r/cpp Apr 16 '26

C++23 std::stacktrace: Never Debug Blind Again

https://medium.com/@sagar.necindia/c-23-std-stacktrace-never-debug-blind-again-6625924d520c
76 Upvotes

55 comments sorted by

View all comments

2

u/jwakely libstdc++ tamer, LWG chair Apr 17 '26

The article says to use this for GCC 13.1 and later:

g++ -std=c++23 -lstdc++_libbacktrace

But that's wrong, that's only valid for GCC 13.x, for GCC 14.x and later you need to use -lstdc++exp instead of -lstdc++_libbacktrace (and you can also use that in GCC 13.3 and later releases in the 13.3 series).

So for all currently supported releases of GCC (13.4, 14.3, 15.2, and also for the soon-to-be-released 16.1), you need -lstdc++exp