Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode link error: file too small for architecture armv7

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

Xcode vers: 4.0.2

If I compile for simulator, i get

... file too small for architecture 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

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

so, it's not from architecture mismatch;

Thanks in advance!

like image 361
codrut Avatar asked Dec 07 '11 09:12

codrut


1 Answers

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.

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

like image 67
codrut Avatar answered Sep 27 '22 17:09

codrut