• Advertisement
Sign in to follow this  

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

This topic is 4947 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Well any operating system where theres a c++ complier which would be practically every one.

Share this post


Link to post
Share on other sites
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
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
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
So if i wrote a c++ program using non specific platform libraries in windows, could i use that on mac?

Share this post


Link to post
Share on other sites
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
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
The executable your compiler generates is compatable only with the environment the compiler is setup for.

Share this post


Link to post
Share on other sites
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
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
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
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
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
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
Sign in to follow this  

  • Advertisement