سؤال

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!

هل كانت مفيدة؟

المحلول 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.

نصائح أخرى

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top