First try Install cross compile packages on debian sudo apt install gcc-x86-64-linux-gnu sudo apt install g++-x86-64-linux-gnu Create cross compile cmake toolchain named linux-x86-64-toolchain.cmake # the name of the target operating system