Xcode 链接错误:对于架构 armv7 文件太小

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8413264/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 22:41:41  来源:igfitidea点击:

Xcode link error: file too small for architecture armv7

xcodecocoa-touchlinker-errors

提问by codrut

I get this strange linker error:

我收到这个奇怪的链接器错误:

ld: in /Users/.../test project/iSMP.framework/iSMP, file too small for architecture armv7

collect2: ld returned 1 exit status Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1

ld:在 /Users/.../test project/iSMP.framework/iSMP 中,文件对于架构 armv7 来说太小

collect2: ld 返回 1 退出状态命令 /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2 失败,退出代码为 1

Xcode vers: 4.0.2

Xcode 版本:4.0.2

If I compile for simulator, i get

如果我为模拟器编译,我得到

... file too small for architecture i386

...对于架构 i386 文件太小

google doesn't help at all..

谷歌根本没有帮助..

I already tried to:

我已经尝试过:

  • re-add the framework
  • clear search path
  • move framework to a different directory and re-add.
  • 重新添加框架
  • 清除搜索路径
  • 将框架移动到不同的目录并重新添加。

Update: output from lipo -info libiSMP-2.1.a

更新:来自 lipo -info libiSMP-2.1.a 的输出

Architectures in the fat file: libiSMP-2.1.a are: armv6 armv7 i386

胖文件中的架构:libiSMP-2.1.a 是:armv6 armv7 i386

so, it's not from architecture mismatch;

所以,这不是来自架构不匹配;

Thanks in advance!

提前致谢!

回答by codrut

I've received the solution from the support team of this framework (thanks guys):

我已经从这个框架的支持团队那里收到了解决方案(谢谢大家):

Symbolic links are turned into flat files when they are moved from OS/X to Windows. The iSMP framework has the following structure: iSMP.framework / iSMP (symbolic link pointing to libiSMP-2.1.a) / Headers / libiSMP-2.1.a

To fix the issue, you might open the terminal application on Mac and move to the iSMP.framework directory. When you type 'ls -l iSMP' command you will notice that the iSMP file has no longer the 'l' attribute. You should then recreate the symbolic link by deleting the iSMP file. type then 'ln -s libiSMP.2.1.a iSMP' .This will create the link.

You may now rebuild the project.

Another solution to fix the problem is to delete the iSMP file and rename libiSMP-xx.a to iSMP.

当符号链接从 OS/X 移动到 Windows 时,它们会变成平面文件。iSMP 框架的结构如下: iSMP.framework / iSMP(符号链接指向 libiSMP-2.1.a) / Headers / libiSMP-2.1.a

要解决此问题,您可以在 Mac 上打开终端应用程序并移至 iSMP.framework 目录。当您键入“ls -l iSMP”命令时,您会注意到 iSMP 文件不再具有“l”属性。然后,您应该通过删除 iSMP 文件来重新创建符号链接。然后输入 'ln -s libiSMP.2.1.a iSMP' 。这将创建链接。

您现在可以重建项目。

解决此问题的另一个解决方案是删除 iSMP 文件并将 libiSMP-xx.a 重命名为 iSMP。

TL/DR: Symbolic links are turned into flat files when they are moved from OS/X to Windows. You need to renew them.

TL/DR:当符号链接从 OS/X 移动到 Windows 时,它们会变成平面文件。您需要更新它们。