Running C++ Program in Unix/Linux/Solaris

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
surchaAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
KeithWatsonConnect With a Mentor Commented:
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
 
mrwad99Connect With a Mentor Commented:
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
All Courses

From novice to tech pro — start learning today.