From: Danny S. <dan...@cl...> - 2010-05-07 06:50:46
|
From: "Ronald Pijnacker" > $ gcc -o small small.m -lobjc > Warning: .drectve `-aligncomm:___CTOR_LIST__,2 ' unrecognized > Warning: .drectve `-aligncomm:___DTOR_LIST__,2' unrecognized > C:\Temp\ccqIYWPK.o:small.m:(.text+0x18): undefined reference to > `objc_get_class' > C:\Temp\ccqIYWPK.o:small.m:(.text+0x2b): undefined reference to > `objc_msg_lookup' > C:\Temp\ccqIYWPK.o:small.m:(.text+0x55): undefined reference to > `objc_msg_lookup' > C:\Temp\ccqIYWPK.o:small.m:(.text+0x83): undefined reference to > `__objc_exec_class' > C:\Temp\ccqIYWPK.o:small.m:(.data+0x4c): undefined reference to > `__objc_class_name_Object' > collect2: ld returned 1 exit status > This works for me: gcc -static small.m -lobjc There are upstream gcc problems with the build of libobjc-2.dll. Namely, the script to build the dll is bit-rotten (and has been so for a looooong time (~10 yrs)). Building the dll without the # ifdef DLL_EXPORT /* defined by libtool (if required) */ # define objc_EXPORT __declspec(dllexport) # define objc_DECLARE __declspec(dllexport) #else # define objc_EXPORT extern __declspec(dllimport) # define objc_DECLARE extern __declspec(dllimport) #endif business in src/libobjc/objc/objc-decls.h and just relying on the default --export-all works for me, but I know hardly anything about objc. I think the gnustep folk had something more elegant. (back in 1998/99) but ... golly, there have been a few brain cells gone AWOL since then. |