I have a problem with some JNI code. I'm getting the following error printed in the console from a OS X 10.4.11 (PPC) machine (it works fine on newer versions of OS X 10.5+)
dyld: lazy symbol binding failed: Symbol not found: _objc_setProperty
Referenced from: /Path/to/my/lib/libMylib32.jnilib
Expected in: /usr/lib/libobjc.A.dylib
dyld: Symbol not found: _objc_setProperty
Referenced from: /Path/to/my/lib/libMylib32.jnilib
Expected in: /usr/lib/libobjc.A.dylib
I have another jnilib which works fine that runs before this one in the program. The error seems to be saying I'm missing some core objective c "stuff". The other jnilib which is working on 10.4.11 uses just 1 .m file and doesn't use objective c properties (it uses NSMutableArray, NSDictionary, CFPreferences and so on). The one which doesn't work on 10.4.11 is more complex makes use of some objective c classes with properites I wrote.
Maybe I'm not compiling my code correctly or maybe properties aren't supported?
I have a shell script which compiles the jnilib. It's practically the same as the one which works as far as I can tell. I have another section for compiling the 64 bit jnilib above this in the script but the 32 bit one is being used for 10.4.11.
COCOA_HEADERS=/System/Library/Frameworks/Cocoa.framework/Headers
BITS=32
JAVA_HEADERS=/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Headers
MAC_SDK=/Developer/SDKs/MacOSX10.4u.sdk
CFLAGS="-fPIC -arch i386 -arch ppc"
LIB_NAME=${LIB_PREFIX}${BITS}.jnilib
MAC_LIB_OUTPUT=/path/to/my/output/folder/${LIB_NAME}
DYLIB_ARCH="-arch i386 -arch ppc"
rm *.o
#Compile for 1.5 32bit Java
gcc -v -std=gnu99 -c ${CFLAGS} -isysroot ${MAC_SDK} -I${JAVA_HEADERS} -I${COCOA_HEADERS} ${SOURCE_FILES}
# Make the library file from the object files (*.o)
gcc -v -dynamiclib -o ${MAC_LIB_OUTPUT} *.o -framework JavaVM -framework Cocoa ${DYLIB_ARCH}
I appreciate your answers and ideas on how to debug this one. Thanks!