Standard C ++ only generates native code for the architecture where it will run, so it has no way to run in a different architecture. The only way is to compile into the appropriate architecture.
Of course a 32-bit application could run on a 64-bit operating system if it has some compatibility layer. This is the case with Windows and some Linux distributions. The opposite is not technically feasible even if someone wanted to do it.
Only compiling for another architecture may not be enough. The code needs to be well written to work well on both. The problem may be there.
Technically it would be possible to have a feature like C # (non-native code), but no one bothered to do this by not making much sense. Even .NET's C ++ / CLI does not allow this.