如何编译一个C ++ 0x代码在Eclipse CDT上mac? [英] How to compile a C++0x code on Eclipse CDT on mac?

查看:136
本文介绍了如何编译一个C ++ 0x代码在Eclipse CDT上mac?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以指向标志和设置更改需要在Mac上的Eclipse CDT上编译C ++ 0x代码?

Can someone point to flags and setup changes required for one to compile C++0x code on a Eclipse CDT on mac please ?

推荐答案

最新的Apple gcc编译器是gcc 4.2,它不支持C + 11代码。您需要安装gcc 4.6 - 这可以从源代码或在 hpc 这里放置一些二进制文件gcc in / usr / local / bin然后在eclipse中的C ++编译器的首选项中使用它。

The latest Apple gcc compiler is gcc 4.2 which does not support C+11 code. You need to install a gcc 4.6 - this can be done from source or there are some binaries at hpc this put the gcc in /usr/local/bin Then use that in the preferences fot the C++ compiler in eclipse.

Lion和以上的替代Xcode 4. *包括clang最新版本其中大部分是C + 11

Alternative for Lion and above Xcode 4.* includes clang the latest version of which doies much of C+11

如果你想以后的gcc macports(和fink和homebrew)有一个更新的版本作为端口。截至2012年7月,macports有4.7.1和4.8测试版。包管理器通常是将复杂的编译代码复制到您的机器上的最简单的方法,并且它们还具有将默认下载的集中编译版本。

If you want a later gcc macports (and fink and homebrew) have a later version as a port. As of July 2012 macports has 4.7.1 and a 4.8 beta. The package managers are often the easiest way to get complex compiled code onto your machine and they also have centrally compiled versions that will be downloaded by default.

这篇关于如何编译一个C ++ 0x代码在Eclipse CDT上mac?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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