Solved

Running C++ Program in Unix/Linux/Solaris

Posted on 2004-09-19
4
238 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

626 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