LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-30-2003, 11:48 PM   #1
aditya_shah
LQ Newbie
 
Registered: Sep 2003
Posts: 5

Rep: Reputation: 0
Compling on a higher version and executing on a lower version


Hi,

I am a newbie to Linux and am trying to write some code to collect system related info from the kernel.

I have provide to support for Red Hat Linux release 6.2 (Zoot) and Red Hat Linux release 7.2 (Enigma) which have Kernel 2.2.14-6.1.1 on an i686 and Kernel 2.4.7-10 on an i686 respectively.

I am using the sysinfo system call and struct sysinfo to achieve this. As it's known that the size and content of struct sysinfo has changed across these platforms.

To have only one library work on both the OS flavors, I plan to compile my code on 7.2 and execute it on both 7.2 and 6.2. I have been doing this and seems to be working fine for me. Incidentally, yesterday while discussing with one of my colleagues, he pointed out that this is not the right way to do it namely "Compiling on a higher version and running on a lower version" is not the path to follow.

I am aware that "Compiling on lower and running on higher" is a supported path and I did give it a thought before implementation but as in my code in 6.2 I do not access any of the variables which are not available and access them only in 7.2. Also, I have not faced any problems as yet but now after him pointing it out am a bit curious to know if I can go ahead in the same manner or should have to executables/libraries for both the OS.

Please provide your views and inputs.

Thanks
-Adi
 
  


Reply



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 On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Regarding distribution + kernel version + gcc version + glib version. JCipriani Linux - General 8 04-19-2008 02:54 PM
Can I drop to a lower kernel version Ratclaws Fedora 1 08-19-2005 12:37 PM
php configuration erro libxml2 version 2.5.10 or higher required raninix Linux - Newbie 2 10-28-2004 10:59 AM
permission denied executing /proc/version syandoa Linux - Newbie 2 03-16-2004 01:02 PM
configure wants lower version of aclocal aus9 Slackware 2 01-20-2004 10:01 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration