Forum Topic: Can you use C++ on Windows for Mac?

(178 views • 5 replies)

This topic is 1 page long.

<< < > >>
None

Venks

Reply To Post Reply & Quote

Posted at: 9/25/09 02:47 PM

Venks DARK LEVEL 08

Sign-Up: 06/08/08

Posts: 56

That subject prolly doesn't make sense, but it's all I could fit.
What I'm wondering is if it is possible to make programs using C++ on a windows computer.
And have those programs run on a Mac computer?

I'm very new to all this so if this doesn't make any sense I'm sorry.


None

henke37

Reply To Post Reply & Quote

Posted at: 9/25/09 03:43 PM

henke37 NEUTRAL LEVEL 23

Sign-Up: 09/10/04

Posts: 3,674

There is no rule against writing a c++ compiler that runs on windows and outputs for mac.
I think there was some merged executable format or something, but I think that required the compilation to be done twice, once in windows and one on mac.

Each time someone abuses hittest, God kills a kitten. Please, learn real collision testing.


None

dmanthe1

Reply To Post Reply & Quote

Posted at: 9/25/09 07:51 PM

dmanthe1 NEUTRAL LEVEL 02

Sign-Up: 11/01/07

Posts: 8

C++ is a non-OS specific programming language. so, if you wanted you could even write stuff for linux on windows if you wish. good luck on learning the programming languages(not sarcasm).


None

Bran-Man

Reply To Post Reply & Quote

Posted at: 9/28/09 05:55 PM

Bran-Man NEUTRAL LEVEL 27

Sign-Up: 06/27/05

Posts: 3,971

Lawl. You can make C++ code and then take the files to a Mac and include them into Objective C (which is the Mac version of C++). C++ code is completely compatible unless you're including a windows based header like windows.h.

Happily Mated

BBS Signature

None

RageOfOrder

Reply To Post Reply & Quote

Posted at: 9/28/09 06:16 PM

RageOfOrder EVIL LEVEL 09

Sign-Up: 08/30/02

Posts: 6,349

I'm surprised nobody has mentions this yet..
You can write the code anywhere you want, and as long as you don't do anything OS specific, you can move the code and it will work anywhere.

BUT

You can't compile it on Windows and then move it and expect it to run anywhere else.
You must move the source code (.cpp file(s)) and compile them on the OS you intend to use them on.

At 9/28/09 06:57 PM, citricsquid wrote:
linux isn't for those who want windows. use windows if you want windows.

BBS Signature

None

littleMonsterGames

Reply To Post Reply & Quote

Posted at: 9/28/09 09:48 PM

littleMonsterGames DARK LEVEL 05

Sign-Up: 12/24/08

Posts: 339

Above it was mentioned not to rely on OS-specific headers.

Same goes for system calls - avoid those as much as possible if you want to be doing cross-platform stuff.

good luck!

The LittleMonsterGames website: http://www.littlemonstergames.com - super fun, I promise :)

BBS Signature

All times are Eastern Standard Time (GMT -5) | Current Time: 04:30 PM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!