gcc 4.9.1 in OS X Yosemite - gcc: warning: couldn’t understand kern.osversion ‘14.0.0'

MMax picture MMax · Oct 21, 2014 · Viewed 36.2k times · Source

I install OS X Yosemite and now i have a huge problem with gcc 4.9.1 compiler. I hope some one can help me please.

I try to compile my program and i have the warning message:

gcc: warning: couldn’t understand kern.osversion ‘14.0.0'

I search on google and i find https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61407 I try to apply the patch doing:

sudo patch -p1 < /usr/local/bin/00-darwin-10.10.patch

in gcc folder: /usr/local/bin/gcc and i received the message:

can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x
|index dd45802..0db14d7 100644
|--- a/fixincludes/fixincl.x
|+++ b/fixincludes/fixincl.x
--------------------------
File to patch:

in File to patch: i already tried gcc and i received the message:

patching file gcc
Hunk #1 FAILED at 1.
Hunk #2 FAILED at 15.
Hunk #3 succeeded at 1274 with fuzz 2 (offset -7908 lines).
Hunk #4 FAILED at 1319.
Hunk #5 FAILED at 1548.
Hunk #6 FAILED at 2671.
patch: **** Can't rename file gcc to gcc.orig : Permission denied

I try with sudo and i received:

can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x
|index dd45802..0db14d7 100644
|--- a/fixincludes/fixincl.x
|+++ b/fixincludes/fixincl.x
--------------------------
File to patch: 

I´m in the wrong folder? Anyone can help me?

Answer

jfraser picture jfraser · Oct 28, 2014

I had a similar issue when building things from source, and it was because I forgot to install the updated command line tools after upgrading to Yosemite and xcode 6.1. Try this in your command line:

xcode-select --install 

That will download and install the command line tools and may fix your problem.