New Issue: 'cannot find -lstdc++' errors

24819, "bradcray", "'cannot find -lstdc++' errors", "2024-04-10T23:41:32Z"

With some (low but unsettling) frequency, we have been getting reports from users of the form:

/usr/bin/ld: cannot find -lstdc++: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: Make Binary - Linking

(or variations on this theme). My understanding is that this usually suggests something is wrong with the underlying C/C++ compilers, or how we invoke them. For example, today's instance was due to gcc-12 being installed without one of g++-12 or libstdc++-12-dev also being installed.

This issue asks what we could be doing to make this issue easier to diagnose (for users, or for ourselves to help users) when it occurs.

  • Update the prereqs doc to contain additional dependencies? (but how to do this given that it seems to be sensitive to gcc versions?)
  • Create a "test the back-end compiler" command that emulates the one(s) our compiler will uses to try to catch and warn about such issues? (e.g., "It seems your C/C++ installation is broken, we couldn't successfully do gcc ...) But when would we run this?
  • Make the compiler itself smarter about catching such errors and printing such a message?

In the meantime, perhaps it can start serving as a place to store information about cases we hit and how to sort them out.