Question:
How do you make it in C++ so that you can create an executable that works on all computers?
anonymous
2009-04-10 16:06:30 UTC
My program that i made is meant for windows xp and i want to know if i would be able to make the executable file usable on all windowx xp computers.

I know how to make an executable, but i dont know how to make it so that i can start it on any windows XP computer.

Can someone please help me.
Thanks in advance.
:)
Six answers:
anonymous
2009-04-10 17:56:41 UTC
Here's a video that shows how to do it. It should run on any windows machine.



http://xoax.net/comp/cpp/visualcpp/CreateExe.php
Shadow Wolf
2009-04-10 16:38:26 UTC
You can embed the program inside one of the emulator programs.



So a program written for Windows will run on a mac or Linux with no changes however, it must always run inside an emulator that is correct for the operating system it runs under.



QEMU for example will allow me to run DSL Linux in a window under Windows. This is just one of many emulators for different circumstances. Another type of emulator will only run programs such as Wine under Linux.



There is also common libraries such as the QT libraries that allow you to do the windows part once and compile for each operating system as needed.



Lastly, if you write the program so that it conforms to the C++ standard, it can be compiled and run on any computer though you'd need the source code to do so. A Windows program does not conform to the C++ standard as it uses operating system specific libraries and calls.



The last reason is one reason why I learned C and then C++ and even Java. It may only be a command line program and not so fancy, but it will work on Windows or Linux in a console window and I'm sure that it would work on a mac with little or no changes.



I'd worry about writing a program that would be popular enough that the fans would need to have a version for all operating systems. Programs for personal use don't count as these have a very limited fan base.



Shadow Wolf
anonymous
2009-04-10 17:07:47 UTC
There's no executable that runs on Windows, Linux and Mac OSX. You could write it portable, so you could compile 3 executables from the same source.
O'Sullivan
2009-04-10 16:23:50 UTC
If it works on your Windows XP, it should work on others, provided install it with any supporting DLL files it needs.
Travis
2009-04-10 16:18:44 UTC
It's impossible.



EDIT:



Ignore Shadow Wolf. He obviously does not understand computer architecture. Again, it is impossible to create en executable that runs on multiple platforms.
mathematix
2009-04-10 16:10:36 UTC
exe is on windows computers

.app is mac you have to make them differently


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...