iOS: _main referenced from _main$non_lazy_ptr
I am trying to create an executable using the following linker command:
/path/to/ld64/i686-apple-darwin9-ld64 -ObjC -dead_strip -L/ -o ../someoutput -exported_symbol _main -Z -F/full/path/to/frameworks -lgcc -lgcc_s.1 -arch arm -lstdc++.6 -lcrt1.o -lSystem.B -lz -lobjc -framework CoreFoundation -framework UIKit -framework MobileCoreServices -framework CoreGraphics -framework Foundation -framework SystemConfiguration -framework AudioToolbox -framework CFNetwork -framework QuartzCore -framework OpenGLES -framework CoreLocation -framework CoreMedia -framework CoreVideo -framework AVFoundation -framework Security
However, I get some warnings like those given below and after that I am getting a fatal error which makes no sense to me:
ld warning: bad symbol version: $ld$hide$os2.1$_OBJC_CLASS_$_NSURL in dylib /full/path/to/CoreFoundation.framework/CoreFoundation
ld warning: bad symbol version: $ld$hide$os2.1$_OBJC_METACLASS_$_N开发者_如何学运维SURL in dylib /full/path/to/CoreFoundation.framework/CoreFoundation
ld warning: bad symbol version: $ld$hide$os2.2$_OBJC_CLASS_$_NSURL in dylib /full/path/to/CoreFoundation.framework/CoreFoundation
ld warning: bad symbol version: $ld$add$os2.2$_OBJC_CLASS_$_NSURL in dylib /full/path/to/Foundation.framework/Foundation
ld warning: bad symbol version: $ld$add$os2.2$_OBJC_METACLASS_$_NSURL in dylib /full/path/to/Foundation.framework/Foundation
ld warning: bad symbol version: $ld$add$os3.0$_OBJC_CLASS_$_NSURL in dylib /full/path/to/Foundation.framework/Foundation
ld warning: bad symbol version: $ld$add$os3.0$_OBJC_METACLASS_$_NSURL in dylib /full/path/to/Foundation.framework/Foundation
ld warning: bad symbol version: $ld$add$os3.1$_OBJC_CLASS_$_NSURL in dylib /full/path/to/Foundation.framework/Foundation
Undefined symbols:
"_main", referenced from:
_main$non_lazy_ptr in crt1.o
ld: symbol(s) not found
What does this mean? How can I resolve this?
精彩评论