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

前端 未结 10 1846
醉梦人生
醉梦人生 2020-12-13 19:18

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

相关标签:
10条回答
  • 2020-12-13 19:29

    The patch you are trying to use is for patching the source code of GCC, and you are trying to use it to patch the compiled binary. That won't work.

    In theory the process would be

    • Download source tarball of GCC compiler
    • apply the patch to it
    • compile GCC
    • Install the compiled GCC

    However, you are unlikely to be able to do this since you cannot run the compiler in order to compile a newer copy of itself. Catch-22!

    Searching google for 'gcc yosemite' I found a number of references to possible solutions, eg. enter link description here. I'm afraid I am no mac expert so I cannot judge the quality of these solutions.

    0 讨论(0)
  • 2020-12-13 19:33

    I am also getting the warning "couldn't understand kern.osversion `14.0.0'" on GFORTRAN compilations while running Yosemite (10.10.1) with Xcode 6.1 and GCC 5.0. The compiler, however, generates functioning executable code and it seems to run correctly. Maybe you can just ignore the warning?

    0 讨论(0)
  • 2020-12-13 19:34

    If you set MACOSX_DEPLOYMENT_TARGET=10.9 in your environment prior to compiling, the shared object linking should work properly.

    0 讨论(0)
  • 2020-12-13 19:36

    if you're using Homebrew, simply:

    brew upgrade gcc
    
    0 讨论(0)
  • 2020-12-13 19:37

    I solved an issue by linking

    export CC=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2
    export CC=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2
    
    0 讨论(0)
  • 2020-12-13 19:38

    It seems to want a current version of XCode command line tools. When I first typed "make" after installing Yosemite I got a warning and a dialog box saying that I did not have XCode command line tools and asked if I wanted to install them. I did so, and everything worked.

    However one user did not get this dialog and instead got the error message as shown. The "xcode-select --install" did not work, so it seems like it may have kept the outdated command line tools and header files.

    The MACOSX_DEPLOYMENT_TARGET=10.9 solution did work for him. However the compiles seemed to be a lot slower.

    0 讨论(0)
提交回复
热议问题