Connecting Tech Pros Worldwide Forums | Help | Site Map

binary incompatibility between linux distributions mainly of Fedora and Debian

Newbie
 
Join Date: Aug 2008
Posts: 1
#1: Aug 29 '08
I build a really `short` application under Fedora 8

int main()
{
return 0;
}

On both above platforms, it is build with command:
g++ test.cpp -o test

where test.cpp is a file with above mentioned code.

I move the binary output test - to my Debian-4 box.
Attempt to execute it is immediately failing with
`Floating point exception`.

Building above code on Debian and executing:
no problem - it is doing nothing, but not crashing...

moving the binary, build on Debian to Fedora and
and running it - no problem, doing nothing, not crashing.

Why is this so???

i have tried many sites but not getting correct answer..

How can i make object code in C++ which can work in all versions of Linux like Suse, Mandrake etc?????

Do i have to add some flags to my gcc compile command....


if anyone knows the answer post me the reply as soon as possible....

JosAH's Avatar
Expert
 
Join Date: Mar 2007
Posts: 10,611
#2: Aug 29 '08

re: binary incompatibility between linux distributions mainly of Fedora and Debian


Just a guess: on one of your machine your libgcc.a was compiled using floating
point software call while on others it wasn't. You can try to recompile your code
using an -fsoft-float flag and see what happens. btw, maybe an -fhard-float can
help a bit as well (us only one of each).

kind regards,

Jos
Reply