Porting

Status
Not open for further replies.

ModerNietz

Baseband Member
Messages
53
The concept of porting have been keeping confuse me. It is the process of adapting software so that an executable program can be created for a computing environment that is different from the one for which it was originally designed. How can it be possible? What makes the C language very portable?
 
For example you have a program that runs on Windows, but you want to port it to Linux. Well Linux is a very different environment which means the program will have to linked against different libraries. E.g. For Windows the program may link to kernel32.dll, however that doesn't exist for Linux. There are functions that may be available on windows but not on Linux, and vice versa. Then there is the issue of different locations for libraries etc, and how these locations are specified. For example a path in Windows maybe "C:\Program Files\my_library.dll", however in Linux this would be "/usr/lib/my_library.so". Much of the fundamental code wouldn't change i.e printf() or scanf(), however they have to be linked to different locations.

These are just a couple of issues, but there are many depending on what the program does. Porting for Windows 98 to XP may not involve many changes but from Windows to Linux or Solaris or some other Operating system the change can be many.
 
Now I have a better understanding. C is relatively portable because its feature relating system makes the code changes less. Now I've got c video player source code for Linux(Suse), How would I make it to be executable?
 
If you want really portable code, use Java. The c.lass files will run on any machine with the jvm installed, and there is a jvm for about every modern OS out there.
 
Status
Not open for further replies.
Back
Top Bottom