如何通过 TextWrangler 运行程序?
我刚刚开始在 MacBook Pro 上尝试 C++,并且对这一切都非常陌生。通过研究,一些不同的人建议使用 TextWrangler 来编写代码。我已经整理了教程开头给我的一些代码,但我现在不确定如何通过 TextWrangler 运行它。我知道你应该先编译它,但这主要是我陷入困境的地方。我已经下载了 Xcode,所以我有 gcc,但我不知道从那里去哪里。编译完成后,有没有一种简单的方法来运行该文件?就像我说的,我对这一切都非常陌生,并且可能以错误的方式看待它。
I have just started to get experiment with C++ on my MacBook Pro, and am very new to it all. Through research, a few different people have suggested to use TextWrangler for writing the code. I have put together some of the code that the beginning of a tutorial has given me, but I am now unsure how to run it through TextWrangler. I know that you are supposed to compile it first, but that is mostly where I'm stuck. I have downloaded Xcode so I have gcc, but I don't know where to go from there. And after I have compiled it, is there a simple way to run the file? Like I said, I am very new to all of this and may be looking at it in the wrong way.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
TextWrangler只是一个文本编辑器,你仍然需要一个编译器来编译你的代码,然后你需要运行你的代码。
Xcode(它是一个 IDE)会为您完成所有这些工作,因此这种困惑是可以理解的。
现在打开一个终端并执行
g++ filename.cpp
进行编译并执行./a.out
运行您的程序即可。但您确实必须学习使用 IDE 或如何编写 makefile。TextWrangler is only a text editor, you still need a compiler to compile your code and then you need to run your code.
Xcode (which is an IDE) does all that for you so the confusion is understandable.
for now opening a terminal and doing
g++ filename.cpp
to compile and./a.out
to run your program will get you going. But you really have to learn to use a IDE or how to write a makefile.