Statically compiling C++ using WSL in Visual Studio
I compiled a program using Windows 10 and Visual Studio 2019 with WSL (Windows Subsystem for Linux). However when I ran the program on a server, it printed an error message:
/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found
The code does not have any external dependencies other than standard C++ libraries, i.e., all of the source files are in the project.
It seems to be the case that WSL did not statically compile the executable but relies on external libraries. I configured the project to compile statically (right-click on the project / Properties / Configuration Properties / General / Project Defaults / Use of STL: Static GNU Standard C++ Library (-static)), however the resulting executable did not change at all.
Could you please help me out? I would greatly appreciate it!