Mac OS X GCC Framework Search Path: / System / Library Before / Library?

I am trying to compile a project on Mac OS X that references Python. I have a Python 2.7 framework in /Library/Frameworks. I am compiling for Mac OS X 4, so I also have Python 2.3 in /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks. If I call gccwith -F/Library/Frameworksand look at what he is doing with -v, I see the following:

ignoring duplicate directory "/Library/Frameworks"
  as it is a non-system directory that duplicates a system directory
<skipped>
#include "..." search starts here:
#include <...> search starts here:
 <skipped>
 /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks (framework directory)
 /Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks (framework directory)

those. it ignores mine /Library/Frameworksbecause it is a duplicate (from the last path, which is a symbolic link to /Library/Frameworks), and then finds its own Python 2.3 structure before mine 2.7.

I understand how to get around this (for example, use -Iwith the full path to the include directory), but I'm somewhat puzzled by the search order. For instance. linker ( ld) seems to be looking for the system / library and library in a different order . I tried to check guides and google, but apparently my skills are too small :)

I think my questions are:

  • This is normal behavior and why gccdoes it search in this order and lddoes it search in different ways?
  • Are there any platform-based methods to solve this problem, or should I use a plain old flag -I?
+5
source share
1 answer

, , - gcc ld . , llvm / Apple. , , , .

:

$ mkdir Frameworks
$ ln -s /Library/Frameworks/Python.framework Frameworks
$ gcc -FFrameworks -E t.c
+4

All Articles