如何从我的Mac终端窗口运行g ++ [英] How to run g++ from a terminal window on my Mac

查看:92
本文介绍了如何从我的Mac终端窗口运行g ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的C ++程序,我可以编译(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.

在我的家用电脑上:当我添加 / Developer / usr / bin 到我的 PATH 我可以运行g ++,但不能包括< string> 不能识别 printf 和这样的函数。

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?

推荐答案

当你安装Xcode和iPhone SDK时,框用于Unix开发支持?我有很多问题与这种事情,因为我没有这样做,解决方案是卸载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.

这篇关于如何从我的Mac终端窗口运行g ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆