Results 1 to 3 of 3
Hello. I have a software in C for which i would like to build linux binaries for i386 and x86_64 platforms. I installed ubuntu 9.04 for the 32 bit build ...
- 09-27-2009 #1Just Joined!
- Join Date
- Dec 2007
- Posts
- 3
C binary building
Hello. I have a software in C for which i would like to build linux binaries for i386 and x86_64 platforms. I installed ubuntu 9.04 for the 32 bit build environment but after i built the binaries it didnt run on other distributions, not even debian which ubuntu is based on, something weird because it has the -marc=i586 gcc flag set, but it did run on ubuntu 8.04, so the only thing i can think of is binary incompatibility across distributions.
So my question is what can i do to compile binaries that would run on most linux platforms, maybe you could give me a few tips about a more generic distribution or gcc flags that would ensure a high level of compatibility, for both 32 and 64 bits. Btw, the software has no external dependencies and uses just ANSI C libraries.
Thanks.
- 09-28-2009 #2Linux Newbie
- Join Date
- Jan 2008
- Location
- Canada
- Posts
- 109
Hi rabusmar
Are you using Static or Dynamic linking. Could you post the output from 'file {your executable}'? It may be that the libraries which were on the compiling machine are not available, avaialable in another location, etc.. Try to compile using Static, if you are using Dynamic links; and see if it is more portable. Hope this helps in some way. Cheers...
Robert
- 09-28-2009 #3Just Joined!
- Join Date
- Dec 2007
- Posts
- 3
I installed the gcc-3.4 package in ubuntu 9.04 (gcc version is 4.3) and it seems its working, ive run it on a couple of other distros when it didnt run before :/.
This was the error i was having:
And info about the file (the one compiled with gcc-3.4):Code:qagamei386.so) failed: "/lib32/libc.so.6: version `GLIBC_2.4' not found (required by .......................qagamei386.so"
Code:$ file qagamei386.so qagamei386.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped $ ldd qagamei386.so linux-gate.so.1 => (0xb80c6000) libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7b02000) libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7adc000) libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7978000) /lib/ld-linux.so.2 (0xb80c7000)


Reply With Quote