尝试了解 MacBook 上的 Aquamacs 和 Terminal

发布于 2024-12-01 21:09:45 字数 505 浏览 2 评论 0原文

我正在上这门计算机编程课程,我对教授给我的说明感到困惑,因为我有一台 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

北城半夏 2024-12-08 21:09:45
  1. 您需要打开应用程序/实用程序中的Terminal。这是您调用编译器 (g++) 的地方。请注意,当您打开终端时,您将位于您的主目录,即/Users/yournamehere
  2. AquaMacs 是一个文本编辑器。它打开并保存文件。虽然它可以做很多其他事情,但最好不要让事情进一步复杂化。请注意,保存文件时,请将它们保存到您的主目录(以您的名字命名的目录)或您可以找到它们的位置。 (顺便说一句,您的 Mac 已经在命令行(终端)上附带了 emacs。只需键入“emacs”即可。)
  3. 为了让 g++ 出现在您的系统上,您必须安装XCode(Apple 的开发工具)。 XCode 要么作为安装程序出现在安装 DVD 上,要么预装在系统上(但是,您仍然必须安装它!)。如果没有,可以从 http://developer.apple.com 免费下载

总而言之,这是最好的与使用 Mac 或 Linux 机器的人坐下来帮助您掌握基础知识。

  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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文