The reason is that the location of
io.h is different for different Linux platforms.
io.hunder Windows can be included directly;
sys/folder, and the name is different, it becomes
The solution is to add a macro definition branch when including
io.h to detect whether the current platform is Windows, x86 Linux or ARM Linux. For example (
__ARM__ is a macro definition added in your project.):
#ifdef WIN32 #include <io.h> #elif defined(__ARM__) #include <sys/uio.h> #else #include <sys/io.h> #endif