iOS:_main 从 _main$non_lazy_ptr 引用

发布于 2024-10-21 08:03:22 字数 1818 浏览 0 评论 0原文

我正在尝试使用以下链接器命令创建一个可执行文件:

/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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文