iOS:_main 从 _main$non_lazy_ptr 引用
我正在尝试使用以下链接器命令创建一个可执行文件:
/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
但是,我收到一些警告,如下所示,之后我收到一个致命错误,这对我来说毫无意义:
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_$_NSURL 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
这是什么意思?我该如何解决这个问题?
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_$_NSURL 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论