943,640 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 2357
  • C++ RSS
May 16th, 2008
0

how to create a Linux distro independent code

Expand Post »
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...
Reputation Points: 10
Solved Threads: 0
Newbie Poster
varsha0702 is offline Offline
18 posts
since Nov 2007
May 16th, 2008
0

Re: how to create a Linux distro independent code

it should work on all distros. Most likely due to bad programming.
Moderator
Featured Poster
Reputation Points: 1764
Solved Threads: 574
Moderator
jbennet is offline Offline
16,485 posts
since Apr 2005
May 16th, 2008
0

Re: how to create a Linux distro independent code

Click to Expand / Collapse  Quote originally posted by jbennet ...
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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
varsha0702 is offline Offline
18 posts
since Nov 2007
May 16th, 2008
1

Re: how to create a Linux distro independent code

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.
Team Colleague
Reputation Points: 2240
Solved Threads: 338
Vampirical Lurker
John A is offline Offline
5,055 posts
since Apr 2006
May 19th, 2008
0

Re: how to create a Linux distro independent code

Click to Expand / Collapse  Quote originally posted by John A ...
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++.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
varsha0702 is offline Offline
18 posts
since Nov 2007
May 19th, 2008
1

Re: how to create a Linux distro independent code

Moved.
Team Colleague
Reputation Points: 2240
Solved Threads: 338
Vampirical Lurker
John A is offline Offline
5,055 posts
since Apr 2006
May 19th, 2008
0

Re: how to create a Linux distro independent code

so why not telling us how to get that example code from INTEL side?
Reputation Points: 158
Solved Threads: 98
Master Poster
tesuji is offline Offline
720 posts
since Apr 2008
May 19th, 2008
0

Re: how to create a Linux distro independent code

> 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
Reputation Points: 1159
Solved Threads: 285
Posting Virtuoso
vijayan121 is offline Offline
1,606 posts
since Dec 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Knights Tour Problem
Next Thread in C++ Forum Timeline: combination of strings





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC