Yes, compilers can be used for cross-platform development by generating machine code for different hardware architectures and operating systems. For instance, a C compiler can generate machine code for both a Windows PC and a Macintosh computer, even though they have different hardware architectures and operating systems.