在升级到lion / new xcode之后使用g ++时遇到问题 [英] Trouble using g++ after upgrading to lion/ new xcode
问题描述
我去编译Hello World,发现找不到g ++。经过一番搜索之后,我发现它在/ Developer / usr / bin中。我将其添加到我的路径中,并尝试编译,现在它说它找不到iostream。
显然,我错过了一些关键的设置步骤,但我似乎不知道它是什么。当我为以前的Mac OS升级安装开发工具时,我似乎没有记得任何这些。任何人遇到这个问题或提供一些建议?
我正在compling的代码很简单,文件名helloworld.cpp
#include< iostream>
int main(){std :: cout<< Hello World<<的std :: ENDL; }
试试
g ++ helloworld.cpp
它的名称不能找到iostream.h (没有这样的文件或目录)
感谢您的帮助。
从App Store下载的是Xcode 4.1的安装程序。然后您需要手动运行安装程序。您应该在 / Applications
中找到它。
Just upgraded to Lion from SL, and downloaded xCode from app store.
I go to compile "Hello World" and find that g++ isn't being found. After some searching, I find it in /Developer/usr/bin. I add this to my path, and try to compile, and now its saying it can't find iostream.
Clearly, I missed some key setup step but I don't seem to know what it is. I don't seem to remember any of this when I installed dev tools for previous mac OS upgrades. Anyone else run into this problem or offer some advice?
The code I'm compling is dirt simple obviously, file name helloworld.cpp
#include <iostream>
int main() { std::cout << "Hello World" << std::endl; }
Just trying
g++ helloworld.cpp
and its saying it can't find iostream.h (no such file or directory)
Thanks for your help.
What gets downloaded from the App Store is an installer for Xcode 4.1. You then need to manually run the installer. You should find it in /Applications
.
这篇关于在升级到lion / new xcode之后使用g ++时遇到问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!