May only need sudo apt-get install libc6-dev-i386 gcc-multilib g++-multilib
but if there is a version mismatch between this gcc and the x64 gcc then there will be issues.
So check update-alternatives --config gcc
and use that info to find gcc-<version>-multilib
and then install it.
credit to https://askubuntu.com/questions/453681/gcc-wont-link-with-m32