[Pythonmac-SIG] Accessing CoreFoundation/IOKit from inside a module?

Pascal Oberndoerfer p.oberndoerfer@urheberrecht.org
Wed, 05 Feb 2003 22:21:55 +0100


Hello all.

Isn't it possible to use stuff from "#include
<CoreFoundation/CoreFoundation.h>" from inside a module? Everything compiles
and links fine (using "python setup.py build") as long as I don't use for
example "CFDictionarySetValue()". If I use it I get the following linking
error message:

> cc -Wl,-F. -bundle -framework Python build/temp.darwin-5.5-Power
> Macintosh-2.3/osxtestmodule.o -o build/lib.darwin-5.5-Power
> Macintosh-2.3/osxtest.so

> /usr/bin/ld: build/temp.darwin-5.5-Power Macintosh-2.3/osxtestmodule.o illegal
> reference to symbol: _CFDictionarySetValue defined in indirectly referenced
> dynamic library 
> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation


The same happens with IOKit, of course...

> /usr/bin/ld: build/temp.darwin-5.5-Power Macintosh-2.3/osxtestmodule.o illegal
> reference to symbol: _IOMasterPort defined in indirectly referenced dynamic
> library /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit


What am I missing here? Is this a known issue? What's the problem with an
"indirectly referenced dynamic library"?

Thanks for your help!

Pascal

And yes, I can access the module from the python interpreter, if the linking
doesn't fail.