Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old August 29th, 2008, 02:00 PM
Newbie
 
Join Date: Aug 2008
Posts: 1
Default binary incompatibility between linux distributions mainly of Fedora and Debian

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....
Reply
  #2  
Old August 29th, 2008, 03:28 PM
Moderator
 
Join Date: Mar 2007
Location: Voorschoten, the Netherlands
Age: 52
Posts: 8,463
Default

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
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles