[Pythonmac-SIG] Extension module compile fail, due to isysroot param pointing to sdk without certain headers. Any tips?

Irmen de Jong irmen at xs4all.nl
Tue May 3 20:28:08 CEST 2011


On 3-5-2011 8:20, Ronald Oussoren wrote:
> 
> On 3 May, 2011, at 0:32, Irmen de Jong wrote:
>> 
>> 
>> I'm comfortable with developing in a unix like environment but the sysroot/sdk
>> stuff of OS X is a bit alien to me. Am I supposed to not touch the SDK locations at
>> all? So installing custom libraries should always be done into /usr/local and then
>> referred to by adding explicit -I/usr/local flags to the compile command?
> 
> You shouldn't touch the SDK locations at all, those get erased when you install a new
> version of Xcode.

Roger.

> I haven't looked into the problem you have with automaticly picking up dependencies
> in /usr/local,  AFAIK that should just work the same as without -isysroot.

charon:~ irmen$ cat /usr/local/include/irmen.h
#define FOO 1

charon:~ irmen$ cat test.c
#include <irmen.h>
int main(void)
{
return 0;
}

charon:~ irmen$ gcc test.c
charon:~ irmen$
charon:~ irmen$ gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk test.c
test.c:1:19: error: irmen.h: No such file or directory


According to what gcc prints when compiling with -v, the -isysroot replaces
/usr/local/include include-path (and some others). So it's expected that it now fails to
compile, right? I can get it to compile again when I explicitly add /usr/local/include
to the include path once more:

$ MACOSX_DEPLOYMENT_TARGET=10.4 gcc -I/usr/local/include -isysroot
/Developer/SDKs/MacOSX10.4u.sdk test.c

I guess the situation is the same with libs living in /usr/local/lib.

I'm not entirely sure though if the above is what you were talking about Ronald?


Anyway, I got my stuff to compile in the end. And it will probably get easier in the
future when I decide to replace the aging mac mini I'm doing this on. I had none of
these issues on my other, newer machine which is running OS X 10.6.

Thanks!
Irmen.


More information about the Pythonmac-SIG mailing list