clang linking broken on new install of Mavericks

Discussion in 'Mac Programming' started by EthanMiller, Oct 23, 2013.

  1. EthanMiller macrumors member

    Joined:
    Aug 15, 2011
    #1
    Did a fresh install of Mavericks, installed Xcode, built GMP from source. Tested gcc (which is a link to clang), it works. What doesn't work is linking against libraries:
    Code:
    $gcc test.c -lgmp
    test.c:2:10: fatal error: 'gmp.h' file not found
    #include <gmp.h>
             ^
    1 error generated.
    gmp.h is at /usr/local/include. Any ideas? This worked on Mountain Lion and earlier.

    (This isn't limited to gmp, either. Any library in /usr/include or /usr/local/include doesn't work, I haven't tested other locations.)
     
  2. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #2
    There are command-line options for debugging includes.

    One such option will cause the compiler to list every directory it searches for an includable file.

    Another such option allows you to add a specified directory to the list of searchable directories. The gcc option is -Idir.

    Consult the man page for the gcc or clang command.
     
  3. Madd the Sane macrumors 6502

    Madd the Sane

    Joined:
    Nov 8, 2010
    Location:
    Utah
    #3
    I've found that Clang likes to crash at random times for me on Mavericks. I don't know why…
     

Share This Page