Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Multi-OS applications.

Posted on 2004-03-26
10
Medium Priority
?
196 Views
Last Modified: 2010-04-17
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
Comment
Question by:DrWarezz
10 Comments
 
LVL 14

Expert Comment

by:wayside
ID: 10691939
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
 
LVL 1

Expert Comment

by:sendtojp
ID: 10693178
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
 

Expert Comment

by:michaelwda
ID: 10693326
java would be a better choice for cross platform compatibility.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 7

Expert Comment

by:Jenn3
ID: 10693405
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
 
LVL 9

Author Comment

by:DrWarezz
ID: 10733804
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
 
LVL 9

Author Comment

by:DrWarezz
ID: 10752762
Any ideas?
thanks.
[R.d]
0
 
LVL 7

Expert Comment

by:Jenn3
ID: 10754724
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
 
LVL 7

Accepted Solution

by:
Jenn3 earned 80 total points
ID: 10754740
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
 
LVL 9

Author Comment

by:DrWarezz
ID: 10765782
Jenn3, that's brilliant!
lol - yay, free!
:o) thanks VERY much!
[R.d]
0
 
LVL 9

Author Comment

by:DrWarezz
ID: 10765832
(Thanks to everyone else also though!)
[R.d]
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Loops Section Overview

782 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