Solved

Running C++ Program in Unix/Linux/Solaris

Posted on 2004-09-19
4
232 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This article will show, step by step, how to integrate R code into a R Sweave document
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

705 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now