Parece haber bastantes tutoriales sobre cómo hacer esto, cada uno ligeramente diferente. Espero que alguien pueda reconocer los mensajes de error que recibo y apuntarme en la dirección correcta.Objective-C en Linux Compile Error
Mi código, hm es:
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSLog (@"hello world");
[pool drain];
return 0;
}
Antes de compilar, entran en la consola:
. /usr/share/GNUstep/Makefiles/GNUstep.sh
intento compilar con:
gcc `gnustep-config --objc-flags` -lgnustep-base h.m -o hello
y obtener:
/tmp/ccgLOnpY.o: In function `main': /home/ge/objective-c/h.m:4: undefined reference to `objc_get_class' /home/ge/objective-c/h.m:4: undefined reference to `objc_msg_lookup' /home/ge/objective-c/h.m:4: undefined reference to `objc_msg_lookup' /home/ge/objective-c/h.m:5: undefined reference to `NSLog' /home/ge/objective-c/h.m:6: undefined reference to `objc_msg_lookup' /tmp/ccgLOnpY.o: In function `__objc_gnu_init': /home/ge/objective-c/h.m:8: undefined reference to `__objc_exec_class' /tmp/ccgLOnpY.o:(.data.rel+0x0): undefined reference to `__objc_class_name_NSConstantString' /tmp/ccgLOnpY.o:(.data.rel+0x8): undefined reference to `__objc_class_name_NSAutoreleasePool' collect2: ld returned 1 exit status
¿Puede alguien señalarme en la dirección correcta?
TIA
¿Por qué no se construye con gnustep-make usando GNUmakefile? Aquí está cómo escribir uno http://www.gnustep.it/nicola/Tutorials/WritingMakefiles/index.html –