I am new to using Objective-C and am trying to compile a simple project on Linux. I started by making sure that all of the Objective-C 2.0 features were working so I compiled with -fobjc-arc only to get: -fobjc-arc is not supported on platforms using the legacy runtime
I tried to fix this error by changing the runtime with -fobjc-runtime=gnustep-2.0, only to get this instead:
/usr/bin/ld: /tmp/main-78cbee.o: in function `main':
main.m:(.text+0x24): undefined reference to `objc_autoreleasePoolPush'
/usr/bin/ld: main.m:(.text+0x32): undefined reference to `objc_retain'
/usr/bin/ld: main.m:(.text+0x4c): undefined reference to `objc_msgSend'
/usr/bin/ld: main.m:(.text+0x6e): undefined reference to `objc_storeStrong'
/usr/bin/ld: main.m:(.text+0x77): undefined reference to `objc_autoreleasePoolPop'
/usr/bin/ld: /tmp/main-78cbee.o: in function `.objcv2_load_function':
I get the same error when trying to compile with the nonfragile ABI,
This is the full command I used while trying to compile my hello world program:
clang main.m -fobjc-arc -fobjc-nonfragile-abi -lobjc -lgnustep-base -lm