1

I'm taking this Computer Programming class, and I'm confused with the instructions my professor gave me because I have a Mac and I didn't even have an Emacs, so I ended up downloading Aquamacs. I know how to "find" a file and give it a name and save it, but I don't know how to... compile it?.. using the terminal that came with my macbook (do i need to download another one?). After writing and saving a file named "MyFirstSource.cpp", I'm supposed to write "g++ -Wall -c MyFirstSource.cpp" on the command line(the terminal?) and check if i have any mistakes and explain the use of "-Wall" and "-c". I only got to the part of saving the file, but that was even before I had opened Aquamacs using the terminal.

I'm not trying to get my homework done for me, I just really don't know how to work the Aquamacs and the Terminal to get the answers... Just so you can have an idea of what I'm doing, after that last step, when I don't have any more mistakes in the text of the file, I'm supposed to enter "g++ -o MyFirstProgram MyFirstSource.o"... and explain in my own words what happens... Clearly, I need help, so please! Anyone who has anything to say about this, your comment is welcome. (I don't need anyone to point out that I'm clueless, I know that!) Thanks! :)

Andrea
  • 11
  • 2

1 Answers1

2
  1. You will need to open Terminal which is in Applications/Utilities. This is where you invoke your compiler (g++). Note that when you open the Terminal, you will be in your home directory, which is at /Users/yournamehere
  2. AquaMacs is a text editor. It opens and saves files. While it can do tons of other things, its best to not complicate the matter further. Note that when saving files, save them to your home directory (the one named after you), or somewhere where you can find them. (As an aside, your Mac already comes with emacs on the command line (the Terminal). Just type 'emacs'.)
  3. In order for g++ to appear on your system, you must install XCode (Apple's Developer tool). XCode either came as an installer on your install DVD or pre-loaded on the system (however, you still must install it!). If not, it is a free download from http://developer.apple.com

All in all, it is best to sit down with someone using a Mac or a Linux machine to help you get the basics down.

Yann Ramin
  • 32,895
  • 3
  • 59
  • 82
  • 1
    +1 for having the patience that I do not. One thing I might add, though: emacs, and even AquaMacs, sound like total overkill by a beginner who is overwhelmed by everything else right now. To that end: [TextWrangler](http://www.barebones.com/products/textwrangler/) or another editor which `*gasp*` actually user-friendly. – Matt Ball Aug 26 '11 at 01:57
  • Is there any way I can download an older version of XCode? I can't download XCode 4 from Apple because I'm still running on Snow Leopard and it requires Lion. Anyway, thank you so much for your help. :) – Andrea Aug 26 '11 at 02:00
  • @Andrea: It should either have the installer preloaded on your system, or its available from here: https://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20792 (you will need a free Apple account) – Yann Ramin Aug 26 '11 at 02:13
  • @Andrea XCode 4 most definitely does _not_ require Lion. – Matt Ball Aug 26 '11 at 02:50
  • Prior to Lion, the Xcode installer is on the system install disc, by the way. – Chris Page Aug 26 '11 at 03:37