Question

How can I compile it on a 32-bit system so it can run as backward compatible under a 64-bit system? I know it can be done because Adobe, Dropbox and other companies have such binaries. How should I link them, dynamically, statically? Static only some libraries and other dynamic?

I'm talking about a simple code like:

int main() {
  printf("Hello world!\n");
}

Thank you!

Was it helpful?

Solution 2

Typically, you compile either both versions, or compile only a 32-bit version, and require that the user has the 32-bit libraries installed.

You can tell GCC to compile for 32-bit by adding -m32 to every command. Note that this requires a multilib compiler, and you need to have the necessary lib32* files installed.

OTHER TIPS

Normally. Then install the 32-bit libraries on the 64-bit system.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top