The reason is: the environment variable (cross-compilation path) may be added under the ordinary user, so when the file created under the root user is compiled with arm-linux-gcc, arm-linux-gcc cannot be found.
Solution: Find a terminal: sudo -s
source ~/.bashrc
You can recompile again, provided that the cross-compilation path is added in ~/.bachrc.