Solved

Running C++ Program in Unix/Linux/Solaris

Posted on 2004-09-19
4
236 Views
Last Modified: 2013-12-05
I am trying to compile a program in Borland C++. Can I run the file in Unix/Linux/Solaris.
I want to know if I can use it in any OS

Thanks in advance
0
Comment
Question by:surcha
4 Comments
 
LVL 3

Accepted Solution

by:
KeithWatson earned 63 total points
ID: 12095818
Your program may or may not be easily portable to other operating systems depending on its content. You will need to re-compile the program for the target operating system using an appropriate compiler, such as GCC.

If your program is a vanilla C++ program using no OS-specific libraries then it ought to compile fairly easily; however, if you use libraries such as the Win32 API, then these calls will not (without additional software/effort) compile easily to a Unix platform.

Borland Kylix provides a solution that allows programs to be cross-compiled for Linux and Windows. I can see no mention of Solaris or other Unix platforms.

Hope that's of use.
0
 
LVL 19

Assisted Solution

by:mrwad99
mrwad99 earned 62 total points
ID: 12096089
Essentially KeithWatson is correct in all senses.

Just a little elaboration; if borland only generates EXE files then you need to recompile on the target platform.  An EXE for Windows cannot be run on UNIX or other.

>> then these calls will not (without additional software/effort) compile easily to a Unix platform.

Yup.  Like WSock32 (Winsock), or all the threading architecture (i.e. pthreads on UNIX, usually HANDLES on Windows).
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A short article about a problem I had getting the GPS LocationListener working.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question