Crosscompiling issues going from Ubuntu terminal to RPI4

It seems that I have solved the issue by downloading the specific aarch64 gcc and g++ compilers instead of normally just install gcc and g++

apt-get install gcc-aarch64*-*-*
apt-get install g++-aarch64*-*-*