https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82172
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2017-09-21 Component|c++ |libstdc++ Assignee|unassigned at gcc dot gnu.org |redi at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> --- Another workaround is to disable the explicit instantiation declarations: // Include a libstdc++ header, so config macros are defined: #include <ciso646> // Disable explicit insantiation declarations in later includes: #undef _GLIBCXX_EXTERN_TEMPLATE #include <sstream> int main() { std::stringbuf myStringBuf{}; myStringBuf.sputc('a'); return 0; } This suggests the explicit instantiations in libstdc++.so are incompatible with the C++17 declarations in the headers.