Solved

Multi-OS applications.

Posted on 2004-03-26
10
192 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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 20 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

This is an explanation of a simple data model to help parse a JSON feed
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

809 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