Heres the situation:
I am taking a C++ course online. I had a PC up until about a week ago when i got a Mac. Now i must do all my work on the only computer i have, the Mac. I turn in my work at the end of the week by uploading it online. I was using Visual Studios but now i cannot =/

I've searched for a Mac compilier and I am unaware where to find one. I also noticed while i was reading at some old posts about this that someone mentioned something about not being able to work on a mac if compilied on a PC. Would that also work vise versa? So in other words, If i compile it on the Mac, will it work on a PC?

I believe GCC comes with Mac OSX. There's the Xcode IDE as well, but I'm not sure what compiler it uses. Unless you're using one of those Mac Minis, you should already have a compiler installed and ready to go.

>If i compile it on the Mac, will it work on a PC?
No. When you compile your code, it turns it into binary executable instructions that only work on the system that it was compiled for. However, if you write portable C++, you can recompile the code on the PC and it will work.

commented: awesome +1

I have one of the new IMac with the new OS on it.
2.4GHz Intel Core 2 Duo
3 GB memory
320GB hard drive1
8x double-layer SuperDrive
ATI Radeon HD 2600 PRO with 256MB memory

<you should already have a compiler installed and ready to go.
im not too sure what GCC is, or even where to find it.

<if you write portable C++, you can recompile the code on the PC and it will work.
I was sending just the c++ file over, not anything else. Would that be fine?

In OSX just open a command-line window and type gcc or g++ to use the compiler.

For example, if you have a program source file "palindrome.cpp" then type g++ palindrome.cpp -o palindrome to compile the program. Type palindrome to run the program. You must, of course, be in the same directory as the source file.

Your professor won't be interested in the binary. He only wants to see your source code, so you are fine just sending the cpp file over.

Good luck.

>im not too sure what GCC is, or even where to find it.
GCC standards for GNU Compiler Collection. Open a command line and type "g++ --version" to see if the C++ compiler is installed and easily accessible.

>I was sending just the c++ file over, not anything else. Would that be fine?
It might be fine. Or it might not. It really depends on whether or not your code uses non-portable features.

word.

Right now im chillin at my schools library which for some retarded reason does not have a C++ compilier on any of the computers i can get on. GG school compters. I'll drive home and test it out. I'll keep you posted. And thanks Narue and Duoas, I appriciate it.

Btw, i do want to say that because of people like you this site will be my new home for posting. I know i am fairly new to C++ but right now im going to college to be a computer engineer so I shall be coming back to help with what i can.

love ya'll like a fat kid loves cake.

:)

>I went to the apple site after trying to find GCC and i found this:
A cross-compiler probably isn't what you want. Just stick to a Mac compiler and keep to standard C++. Your code will recompile on other systems without a problem. Cross-compilers are used when you want to develop for a system that you don't have ready access to or to simplify development. One example is a cross-compiler/emulator for embedded processors that runs on a Linux box. That way you can develop on Linux, for your toaster, without having to deal with your toaster's development interface.

>I tried using terminal and console to find it, but had no luck.
Look for Xcode then.

Xcode is a negative as well

I finally said F it all and got parallels with XP.
End of story.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.