I build my C++ program using gcc 10 in Ubuntu 20.04, and then run it in Ubuntu 18.04, but unfortunately get errors as follows:
/opt/aspen/my: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /opt/my/myRenderer.so)
/opt/my/my: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /opt/my/libpython3.8.so.1.0)
/opt/my/my: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /opt/my/libpython3.8.so.1.0)
Is it possible to fix this issue by installing some additional packages in Ubuntu 18.04?
There are some ways
1. install gcc
on your current machine e.g. compile it from source. It does not guarantee - since you may need to have a higher version of glibc
2. Upgrade the whole machine you have.
3 compile it on first machine (Ubuntu 20) into static binary file not dynamic one, then you can run it almost everywhere.
Note. You may think of just compiling glibc
on your machine - it is possible to do but since many others libraries are depended on glibc
so may face errors for running CMDs or other programs. The safest one is option 3 static build.