C ++ that generates object code for two different machines
Yes, that's exactly what cross compiler is .
The GNU Compiler Collection (including gcc and g ++) is a prime example of a portable cross-compiler with hundreds of supported processor types.
There are many ways to set up GCC as a cross compiler. Most of them depend on the target machine and what is available from it - mainly due to the C runtime. For example, compiling GCC for an ARM Linux target requires a pre-compiled glibc for ARM Linux to build the libstdC ++ cross compiler.
source to share
Yes, there are such compilers; yes they are called cross compilers. For example, GCC can be configured so that I can run the compiler on a 32-bit x86 system, but produce 64-bit code on an x64 system, and that's just the tip of the iceberg.
Crosstool is a really handy set of tools for building cross-compiling GCC.
NTN,
Eric Melsky
Electric Cloud, Inc.
source to share