Troubles with gcc 9

A GMT user posted an issue that I was able to reproduce in WSL2 + gcc9. The error is

ERROR: LoadError: LoadError: could not load library "/home/j/programs/lib/libgmt.so"
/home/j/programs/julia/bin/../lib/julia/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /usr/lib/libgdal.so.26)

Googling I found this SO post mentioning a fixed bug in gcc9 that might affect linking against objects built with gcc that had not that bug fixed.

As an experiment I moved away the julia/bin/../lib/julia/libstdc++.so.6 and GMT started to work. Ofc, this was just to test but the user told me that he built Julia master and the issue went away.

It’s strange that this does not affect more people, but it dis afffect two today.

Thanks, but what is the solution? Installed Julia 1.5.2 but the problem persists.

The issue is still open --> no real solution :slightly_smiling_face:

The fact is: pre-built Julia ships a specific version of libstcd++, the one corresponding to GCC v8.1.0, (GLIBCXX_3.4.25, CXXABI_1.3.11), you’re calling into system libraries linked to system libstdc++, which is newer than the one shipped with Julia referencing a symbol tagged with GLIBCXX_3.4.26, hence the error. Building Julia from source uses system libstcd++

OK, so far just moving the older libstcd++ out of the way seems to work. This is a testing environment anyway.