Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

EthanMiller

macrumors member
Original poster
Aug 15, 2011
73
3
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.)
 

chown33

Moderator
Staff member
Aug 9, 2009
10,751
8,422
A sea of green
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.