尝试了解 MacBook 上的 Aquamacs 和 Terminal
我正在上这门计算机编程课程,我对教授给我的说明感到困惑,因为我有一台 Mac,但我什至没有 Emacs,所以我最终下载了 Aquamacs。我知道如何“查找”文件并为其命名并保存,但我不知道如何...编译它?...使用我的 macbook 附带的终端(我需要下载另一个文件吗? ?)。编写并保存名为“MyFirstSource.cpp”的文件后,我应该在命令行(终端?)上编写“g++ -Wall -c MyFirstSource.cpp”并检查是否有任何错误并解释使用“-Wall”和“-c”。我只完成了保存文件的部分,但那是在我使用终端打开 Aquamacs 之前。
我并不是想帮我完成作业,我只是真的不知道如何使用 Aquamacs 和终端来获得答案......只是为了让你知道我在做什么,之后最后一步,当我的文件文本中没有更多错误时,我应该输入“g++ -o MyFirstProgram MyFirstSource.o”...并用我自己的话解释发生了什么...清楚,我需要帮助,所以请!大家对此有什么想说的,欢迎留言。 (我不需要任何人指出我无能,我知道!)谢谢! :)
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! :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Terminal
。这是您调用编译器 (g++
) 的地方。请注意,当您打开终端时,您将位于您的主目录,即/Users/yournamehere
g++
出现在您的系统上,您必须安装XCode(Apple 的开发工具)。 XCode 要么作为安装程序出现在安装 DVD 上,要么预装在系统上(但是,您仍然必须安装它!)。如果没有,可以从 http://developer.apple.com 免费下载总而言之,这是最好的与使用 Mac 或 Linux 机器的人坐下来帮助您掌握基础知识。
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
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.comAll in all, it is best to sit down with someone using a Mac or a Linux machine to help you get the basics down.