为什么我的g ++和gcc版本没有升级? [英] why didn't my g++ and gcc version get upgraded?

查看:981
本文介绍了为什么我的g ++和gcc版本没有升级?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Mac上。我把OSx更新为优胜美地。我更新了我的xcode到版本6.我下载了命令行工具。



而且,每当我输入g ++ --version,我得到:

 #g ++ --version 
无法理解kern.osversion`14.1.0'
i686-apple-darwin11- llvm-g ++ - 4.2(GCC)4.2.1(基于Apple Inc. build 5658)(LLVM build 2336.11.00)
版权所有(C)2007免费软件基金会,
这是免费软件;看到复制条件的来源。没有
保修;甚至不适用于适销性或适用于特定目的。

意思是,我还在使用旧版本的g ++和gcc。



为什么没有升级?我有兴趣在Eclipse中使用c ++ 0x,而且我需要一个更新的g ++ / gcc编译器。



编辑:在下面的评论之后,我有两个问题:



为什么

  $ clang --version 
Apple clang版本4.1(标签/ Apple / clang-421.11.66)(基于LLVM 3.1svn)
目标:x86_64-apple-darwin14.1.0
线程模型:posix

我还好像有一个老版本的俚语?



为什么没有安装xcode和命令行工具创建正确的链接到clang?

解决方案

我有一个类似的问题升级到优胜美地之后安装ios-deploy。我得到相同的

 无法理解kern.osversion`14.1.0'

为gcc。我最终解决了:

  cd / opt / local / bin / 
sudo rm gcc
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/bin/gcc gcc

正确指向gcc到Xcode 6.1提供的版本。


I am on a Mac. I updated my OSx to Yosemite. I updated my xcode to version 6. I downloaded the command line tools.

And still, whenever I type in g++ --version, I get:

# g++ --version
couldn't understand kern.osversion `14.1.0'
i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

meaning, I am still using the old version of g++ and gcc.

Why wasn't it upgraded? I am interested in using c++0x in Eclipse, and for that I need a newer g++/gcc compiler.

EDIT: following the comment below, I have two questions:

Why

$ clang --version
Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin14.1.0
Thread model: posix

do I still seem to have an old version of clang?

Why didn't the installation of xcode and the command-line tools create the proper links to clang?

解决方案

I had a similar problem installing ios-deploy after upgrading to yosemite. i was getting the same

couldn't understand kern.osversion `14.1.0'

for gcc. I ultimately solved it by:

cd /opt/local/bin/
sudo rm gcc
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/bin/gcc gcc

This correctly pointed gcc to the the version provided by Xcode 6.1.

这篇关于为什么我的g ++和gcc版本没有升级?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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