Using Macports libraries in Xcode gcc

Rainer Müller raimue at macports.org
Sat Jan 10 12:17:07 PST 2009


Vince Rice wrote:
> My question is what I have to do to my gcc setup to get it to "see"
> the Macport installed libraries (not just popt, but any other
> libraries I might download). I've tried adding the -I and -L's to the
> gcc command, and the popt.h is found, but it complains about the
> library, e.g. ld: library not found for -l/opt/local/lib/popt

gcc flags don't work like that. You need to specify the search path for
libraries using -L and then the library itself using -l.
In your case this should be:

  gcc ... -L/opt/local/lib -lpopt ...

HTH,
Rainer


More information about the macports-users mailing list