如何运行 g++从我的 Mac 上的终端窗口
我有一个简单的 C++ 程序,可以编译(从命令行使用 g++)并从我的工作计算机运行,但不能从我的家庭计算机运行。我不知道他们有什么不同!它们都是 macbook,我都在它们上安装了 iPhone SDK。
在我的家用计算机上:当我将 /Developer/usr/bin
添加到我的 PATH
时,我可以运行 g++,但它不能包含
> 并且它无法识别 printf
等函数。我还需要做什么才能使 g++ 工作?
I have a simple C++ program that I can compile (g++ from command line) and run from my work-computer but not from my home-computer. I don't know how they differ! They are both macbooks and I have installed iPhone SDK on both.
On my home-computer: When I add /Developer/usr/bin
to my PATH
I can run g++ but it cannot include <string>
and it does not recognize printf
and such functions. What else do I need to do to make g++ work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当您安装 Xcode 和 iPhone SDK 时,您是否选中了 Unix Development Support 复选框?我在这类事情上遇到了很多问题,因为我没有这样做,解决方案是卸载 SDK 并在选中该框的情况下重新开始。
When you installed Xcode and the iPhone SDK, did you check the box for Unix Development Support? I had a lot of problems with this sort of thing because I didn't do that, and the solution was to uninstall the SDK and start again with the box checked.