Solved

Multi-OS applications.

Posted on 2004-03-26
10
193 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
[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
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
The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

 
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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Progress

726 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