clang linking broken on new install of Mavericks

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

  1. EthanMiller macrumors member

    Aug 15, 2011
    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:
    $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

    Aug 9, 2009
    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 6502a

    Madd the Sane

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

Share This Page