[Pythonmac-SIG] Trying to build PyObjC on MacOSX -- what's missing? (fwd)
Steven D. Majewski
sdm7g@minsky.med.virginia.edu
Mon, 6 Nov 2000 13:33:07 -0500 (EST)
Is anyone else in Python land working on porting to OSX ?
I'm trying to build the objective-C bindings (PyObjC) for Python
on MacOSX public beta.
In PyObjC, I:
* fixed (I hope) the call INSTMETH macro in objc_support.h to add missing
2nd arg.
* undated obsolete & missing message send:
NSMethodSignature *methinfo;
[methinfo argumentInfoAtIndex:argn+2].type;
to:
[methinfo getArgumentTypeAtIndex:argn+2];
* added <objc/hashtable.h> to objc_support.h includes
( for obsolete NXHash* functions )
* changed some '#include's to '#import's to keep the warnings down to
a reasonable level so I could find other bugs.
After that, it will compile on MacOSX public beta.
The final link command from the Makefile is:
cc -bundle -undefined suppress ObjC.o ObjCMethod.o ObjCObject.o
ObjCPointer.o ObjCRuntime.o objc_support.o OC_PythonBundle.o
OC_PythonInt.o OC_PythonObject.o OC_PythonString.o -o ObjC.so
Trying to load it from Python, I get:
[localhost:~/Src/PyObjC] sdm% python
Python 2.0 (#3, 10/22/00, 12:04:10)
[GCC Apple DevKit-based CPP 5.0] on Darwin1.2
Type "copyright", "credits" or "license" for more information.
>>> import ObjC
dyld: python Undefined symbols:
.objc_class_name_NSBundle
.objc_class_name_NSException
.objc_class_name_NSInvocation
.objc_class_name_NSMethodSignature
.objc_class_name_NSNumber
.objc_class_name_NSProxy
.objc_class_name_NSString
.objc_class_name_Protocol
_NSSelectorFromString
_NSStringFromSelector
_NXInitHashState
_NXNextHashState
__NSAddHandler2
__NSConstantStringClassReference
__NSExceptionObjectFromHandler2
__NSRemoveHandler2
_class_getInstanceMethod
_objc_getClasses
_objc_lookUpClass
_objc_msgSend
_objc_msgSendSuper
_objc_setMultithreaded
_object_getClassName
_sel_getUid
_sel_isMapped
linking again, adding -lobjc:
[localhost:~/Src/PyObjC] sdm% python
Python 2.0 (#3, 10/22/00, 12:04:10)
[GCC Apple DevKit-based CPP 5.0] on Darwin1.2
Type "copyright", "credits" or "license" for more information.
>>> import ObjC
dyld: python multiple definitions of symbol __objcInit
python definition of __objcInit
/usr/lib/libobjc.A.dylib(objc-runtime.o) definition of __objcInit
which is the same thing I get if I try to link with
"-framework Foundation" instead.
'otool -vR /usr/lib/libobjc_profile.A.dylib' tells me that
some of those symbols are "undefined [lazy]" -- what does
that mean?
-- Steve Majewski <sdm7g@Virginia.EDU>