how to create a Linux distro independent code

Reply

Join Date: Nov 2007
Posts: 18
Reputation: varsha0702 is an unknown quantity at this point 
Solved Threads: 0
varsha0702 varsha0702 is offline Offline
Newbie Poster

how to create a Linux distro independent code

 
0
  #1
May 16th, 2008
Hi..
I have created a shared object by developing and compiling it on RHEL 5.
Than I tried to use same shared object on RHEL 4 and SuSe 10.0.But it didn t work.Error message shown was " Floating point exception". Machine architecture was same for all the three distos.
So I want to know is it possible to compile a code in such a way that if it is compiled on RHEL 5 machine, same compiled code should work on any other Linux distros? If yes than how?

Thanx in Advance...
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 15,986
Reputation: jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all 
Solved Threads: 509
Moderator
Featured Poster
jbennet's Avatar
jbennet jbennet is offline Offline
Moderator

Re: how to create a Linux distro independent code

 
0
  #2
May 16th, 2008
it should work on all distros. Most likely due to bad programming.
If i am helpful, please give me reputation points.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 18
Reputation: varsha0702 is an unknown quantity at this point 
Solved Threads: 0
varsha0702 varsha0702 is offline Offline
Newbie Poster

Re: how to create a Linux distro independent code

 
0
  #3
May 16th, 2008
Originally Posted by jbennet View Post
it should work on all distros. Most likely due to bad programming.
Its a sample code downloaded from Intel site. Which I have compiled to shared object.
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 5,050
Reputation: John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold 
Solved Threads: 331
Moderator
John A's Avatar
John A John A is offline Offline
Vampirical Lurker

Re: how to create a Linux distro independent code

 
0
  #4
May 16th, 2008
Tell me which language the code is written in, and I'll move it to the appropriate forum. Lounges aren't meant for support questions, and you'll receive better help if it's in the Software Development forums.
"Technological progress is like an axe in the hands of a pathological criminal."
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 18
Reputation: varsha0702 is an unknown quantity at this point 
Solved Threads: 0
varsha0702 varsha0702 is offline Offline
Newbie Poster

Re: how to create a Linux distro independent code

 
0
  #5
May 19th, 2008
Originally Posted by John A View Post
Tell me which language the code is written in, and I'll move it to the appropriate forum. Lounges aren't meant for support questions, and you'll receive better help if it's in the Software Development forums.
Its written in C++.
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 5,050
Reputation: John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold 
Solved Threads: 331
Moderator
John A's Avatar
John A John A is offline Offline
Vampirical Lurker

Re: how to create a Linux distro independent code

 
0
  #6
May 19th, 2008
Moved.
"Technological progress is like an axe in the hands of a pathological criminal."
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 296
Reputation: tesuji is on a distinguished road 
Solved Threads: 42
tesuji tesuji is offline Offline
Posting Whiz in Training

Re: how to create a Linux distro independent code

 
0
  #7
May 19th, 2008
so why not telling us how to get that example code from INTEL side?
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 1,089
Reputation: vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all 
Solved Threads: 164
vijayan121 vijayan121 is offline Offline
Veteran Poster

Re: how to create a Linux distro independent code

 
0
  #8
May 19th, 2008
> So I want to know is it possible to compile a code in such a way that if it is compiled
> on RHEL 5 machine, same compiled code should work on any other Linux distros?
the problem is caused by changes in the ELF binary format between RHEL4/FC5 and RHEL5/FC6 or later. (the hash section and the hash format for symbol resolution has changed).
while RHEL5/FC6 and newer can handle both types of hash format, only the classical 'sysv' format is supported by older versions.
to make elf binaries which are backward compatible, use the linker switch --hash-style=sysv
for example while compiling with g++, use -Wl,--hash-style=sysv
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC