Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 198
  • Last Modified:

Multi-OS applications.

Hi all,
Firstly, sorry for the lack of points, 20 is all I've got! :o(
Okay, basically, for future reference, I need to know this:
how to make a C++ program run on different OSs.
e.g.
If I say, use Dev-C++ to compile an .exe. Well, will this .exe run on, say LINUX, or UNIX, etc..
Or, is it required that I use a third-party software of some kind to compile it into something else, that will be compatible to other OSs.
Note: I'm not a PRO-grammer, I'm still kind of new to OOPLs, so be nice with the jargon. :o) HeHe.

Thanks very much in advance,
Regards,

[R.d]
0
DrWarezz
Asked:
DrWarezz
1 Solution
 
waysideCommented:
That exact .exe is unlikely to run directly on a machine with a different OS, they all work differently so you need to compile the program on a machine running that OS.

Plus, there are many different kinds of hardware, each with their own instruction set; they can't run code aimed at another processor.

There are programs/hardware that will let you emulate one kind of OS/hardware on another, for example to run a Windows PC program on a Sun.
0
 
sendtojpCommented:
You have a few choices however.  

Recomplie the code under another complier that supports the other OS and still uses C.  i.e. Linux or Mac (varients of Unix).

Convert the code to be Java, Java run on all machines.  

Use Wine on Linux, Wine runs win apps in Linux.

Take the logic of the code and rewrite in RealBasic,  works in ALL OS's.  Programing time in BASIC is usaualy only a fraction of the time needed for programming in C.

Buy IBM-PC machines (physpophically  speaking Windows machines).  See the big picture, a customer is paying you for something your time is very valuable, $400 for a windows machine is well worth it sometimes.  I hope that you are successful with your programming, keep your eye out and tell people what you do.  You might find some cash along the way.  You might want to learn Visual Basic and MS Access.

-JP
0
 
michaelwdaCommented:
java would be a better choice for cross platform compatibility.
0
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
Jenn3Commented:
Recompiling is pretty much the only way to have A Different version for another OS.

Recompiling the codes in another compiler can be tricky and watch out for minor differences in how Compiler works in different OS. It is expected some codes may need to be addressed differently if the OS is under a very different platform such as Handheld PDA and Desktop.

The best approach is to TRY:
1. Get two compilers for different OSes, and compile two separate .EXE.
2. Runt them to see any problems.
3. Convert the Codes to Java

Good Luck and godspeed.

0
 
DrWarezzAuthor Commented:
Hi all,
thanks very much for all the input - much appreciated.
Okay, I can do quite a bit of Java - but I find C++ soo much easier! I once read that java is the easier and more compatible version of C++. More compatible, yea.. But easier? Not from my point of view. So, that's really why, for now, I want to stick with C++.
Okay then. I think I would like to just get another compiler that supports other OSs. The main OS that I'm bothered about is UNIX - as my dads work need some software, I can do it - but they run UNIX, and I'm on Windows.
So, can someone quite clearly, talk me through the process of compiling an .exe to run on UNIX.?
Possibly suggest some software...?
--
Thanks VERY much all!
[R.d]
0
 
DrWarezzAuthor Commented:
Any ideas?
thanks.
[R.d]
0
 
Jenn3Commented:
Try this site, it has many of the key compilers available for C++ including some tips. Some aremore useful than others.

Checkout Intel - Linux compiler on the list...

http://www.thefreecountry.com/compilers/cpp.shtml

Do watchout compliance to ANSI C/C++ standard when coding and compiling.

Hope that helps.
0
 
Jenn3Commented:
Oh, BTW regarding UNIX try TenDRA as it supports a few flavors of Unix. Did i mentioned it's FREE!!!

God! I love this oxymoron nature: FREE business.
0
 
DrWarezzAuthor Commented:
Jenn3, that's brilliant!
lol - yay, free!
:o) thanks VERY much!
[R.d]
0
 
DrWarezzAuthor Commented:
(Thanks to everyone else also though!)
[R.d]
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now