Sign in to follow this  
johnnyBravo

What operating systems is c++ capable of running on?

Recommended Posts

Palidine    1315
any system in the universe that has a C++ compiler written for it. C++ is a language, languages can run on any platform as they are just an interface between human-readible code and machine-readible code. a compiler+linker translates the C++ language into machine-readible code.

-me

Share this post


Link to post
Share on other sites
C-Junkie    1099
Quote:
Original post by johnnyBravo
Hi, i'm just wondering what operating systems c++ is capable of running on?
Simple answer (and I'm serious)

Anybody who has to ask this question, has never heard of one that it won't "run" on.

Share this post


Link to post
Share on other sites
Ademan555    361
Anything!! c++ is platform independant, as long as there are development tools and libraries for that platform
thats my understanding of if
hope that helps
-Dan

Share this post


Link to post
Share on other sites
Extrarius    1412
If the platform can compute, C++ can run on it. It might take quite a bit of work to get your program working on it though (I'm guessing that you'd need to write your own compiler for quantum machines or something, and I'm guessing it probably wouldn't be easy).

Share this post


Link to post
Share on other sites
SiCrane    11839
Quote:
Original post by johnnyBravo
So if i wrote a c++ program using non specific platform libraries in windows, could i use that on mac?


Signs point to no, unless you use an x86 emulator on the mac end, or a cross compiler on the windows end.

Share this post


Link to post
Share on other sites
Etnu    880
So far as I'm aware, there aren't any platforms that are in use today that don't have C++ compilers for them. Well, maybe some of the stuff that's in the smithsonian...

Share this post


Link to post
Share on other sites
dormlock    127
Yes as long as you stay away from API specific to one platform you could write a program that will compile and run on both systems. As for a game if thats what your trying to do it'll be hard not to use some sort of platform specific API.

Share this post


Link to post
Share on other sites
kevmo    205
Quote:
it'll be hard not to use some sort of platform specific API


That's why libraries such as SDL were made to do the hard work for us.

One thing to watch out for, even if not using platform-dependant API's, is the size of datatypes. In particular, the size of an int varies from platform to platform, and it is feasible for sizes of other datatypes to vary. If your code depends on the size of a certain variable, it is usually a good idea to check the size with sizeof(int) or sizeof(long), etc.

A second thing to watch out for is byte ordering - some systems order the bytes in multi-byte words from most significant to least significant, and some order them the other way around. The main time this would come into play would be in network programming, or when doing low level reading and writing to buffers.

Share this post


Link to post
Share on other sites
Fruny    1658
Quote:
Original post by johnnyBravo
Hi, i'm just wondering what operating systems c++ is capable of running on?


Freestanding C++ implementations don't even need an operating system.

Share this post


Link to post
Share on other sites
antareus    576
Quote:
Original post by C-Junkie
Quote:
Original post by johnnyBravo
Hi, i'm just wondering what operating systems c++ is capable of running on?
Simple answer (and I'm serious)

Anybody who has to ask this question, has never heard of one that it won't "run" on.

Hahahaha. That's great.

Share this post


Link to post
Share on other sites
petewood    819
You can have cross compilers - that is compilers that generate code for a different platform to the one they're running on. So you can compile on a linux machine to make a binary executable for a mac. Or compile on a windows box a binary for a PalmOS.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this