# School: C++ mac to windows



## ThatJive (Oct 3, 2006)

Hello everyone,
I'm currently about 5 weeks into my first programming class. It is a online Java course through a 
local university. I have to move at the end of this semester and will be starting at a different school. 
The new school concentrates on C and C++ for it's first year CS classes.

My question is: I just bought a new Intel Mac Book Pro and would like to continue using it at this new 
school, however, everything at the school is PC. With Java that would'nt be a problem but I'm thinking...
there may be some real issues turning in C++ homework written on a mac and graded on a PC.

Has anyone had to deal with this before? What the the main points I should be aware of? Any work arounds?

Like I said I'm very new at all this, I just like to be prepared.

I guess I can always run BootCamp or Parrallels and do it that way, but not if it can be avoided.

Thanks in advance for any wisdom you send my way.

bill


----------



## ElDiabloConCaca (Oct 3, 2006)

C++ is not system-specific at all, or at least the source code is not.  If your professors require you to turn in source code, you're good to go -- I do all my C, C++ and Java programming on a Mac and turn it into PC-loving professors all the time.  You're actually just turning in a text file when turning in source code, so it wouldn't matter if you created the text on a Mac, a PC, a Sun Solaris or any other computer -- as long as it's pure ASCII text.

Now, if the professors require you to turn in some compiled binary file, I found it's easiest to SSH into the school's computers and compile there.  If you compile on your Mac, the binary won't be executable on a PC and vice-versa.

Mac OS X includes a very nifty IDE that'll handle Java, C and C++: it's called XCode, and is included with your computer.


----------



## ThatJive (Oct 3, 2006)

Thanks a bunch for your reply.
A little peace of mind is a good thing.



> You're actually just turning in a text file when turning in source code, so it wouldn't matter if you created the text on a Mac, a PC, a Sun Solaris or any other computer



Thats good to know. That is what I'm doing for the class I'm in now. I just send the profs my source code file zipped with any data files or image files and they compile and grade.



> Mac OS X includes a very nifty IDE that'll handle Java, C and C++: it's called XCode, and is included with your computer.



That sounds like a good idea. I did use XCode for a couple of "HelloWorlds" When I first got the mac but the switched to Eclipse for the Java class.
As a matter of fact one of the reasons I switched to mac was to take advantage of all the programming languages and tools that come loaded and ready to go. I'm kinda itching to give XCode another whirl.

Once again thanks very much for your reply


----------



## HateEternal (Oct 4, 2006)

I'm no C/C++ guru but can't you just use the arch parameter when you compile with GCC? If that works then the only time you would run into issues is if you needed to use libraries that are specific to windows.


----------



## Captain Code (Oct 8, 2006)

You might be OK for the first year but my college was MS centric and we learned MFC and DirectX which you can't do on OS X.  You can write the code on OS X but you can't test it obviously.  If you're doing basic C++ you are good, I did all my C++ stuff for a science class in OS X because we could do it in whatever language we wanted.

You might just have to get Parallels or use Bootcamp but then of course you need a Windows license.


----------



## ThatJive (Oct 8, 2006)

I finally got through to someone in the CS dept the other day. They said the first semester is going to be some flavor of C with no OOP, second semester will be C++. I am running a XP partition right now, but I just hate to go there after OS X. I guess if we are doing something windows specific I'll just do it.
By the way, The XP was very cheap at Indiana U. They sell copies for $10. Some kind of site licsense.

Thanks  for your reply

bill


----------



## ShosMeister (Oct 23, 2006)

First; I found this doing a search for Mac C++ and Diablo's comments were very helpful except, having an old iMac, I'm not quite sure what XCode is. I'm sure it wasn't in the 10.1-10.2 versions of the OS (or it wasn't loaded by default).

I'm going to be doing the same thing as Jive, the only difference is that I've done it before - years ago when I started working on my degree. At that time, I was using Symantec's C and actually figured out how to write all of the code with compile time directives to handle the differences between Mac and Unix/PC commands. It made the source longer but it worked great! Since I'm going to be doing that again, will XCode work? I'm guessing yes from the comments here.

So the next obvious question is do I have to get a new Intel Mac and/or 10.4.x?

Thanks !!!!!!


----------



## szymczyk (Oct 24, 2006)

On Mac OS X 10.2 Xcode is called Project Builder. Apple changed the name in 10.3. You should have a Developer Tools CD with Mac OS 10.2 that contains Project Builder.

You should be able to write standard C and C++ programs with Project Builder without having to worry about compile time directives. Create a C++ Tool project to write a command-line C++ program, and create a Standard Tool project to write a command-line C program.


----------



## Captain Code (Oct 24, 2006)

Actually XCode was written from scratch to replace Project Builder and is much better for larger projects.  Project Builder really slowed down the bigger your project got but for what you want to do it's good enough.


----------

