Linker Error in Xcode 4.4

After upgrading from Xcode 4.3 to Xcode 4.4, I started getting the following error when creating an iPhone app:

ld: section __objc_const (address=0x0010C720, size=7265990088) would make the output executable exceed available address range for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

The address and memory number mean nothing to me, but they remain consistent between clean and tunable. I donโ€™t understand how to find what they can refer to.

The code did and still compiles in Xcode 4.3.

Does anyone know how I can track the cause of this error?

+7
source share
2 answers

I had the same error. Fortunately, I could remember the moment when he appeared, leaned back and compared the revisions. This was a category with static methods in the Google GAI class. I have no idea why this happened, as other categories in the project work very well, but I hope this helps someone too.

+2
source

You can see the sizes of all characters (including global variables) in the file Link file :

  • In the build settings for your purpose, go to the โ€œLinkingโ€ section and set โ€œLink File to Link Fileโ€ to โ€œYesโ€.
  • Create a program. The compiler will fail, but the link map file will be written.
  • Find the link map file. Log output from the linker shows the -map -Xlinker -/path/to/linkmapfile.txt . It is located somewhere in the DerivedData folder of your project.
  • The link map file shows the addresses (first column) and dimensions (second column) for all characters. For global variables, it shows the name and in which object file they are located.
  • You should find the address of your error message (0x0010C720 in your example) in the link map file.
  • You can check the link map file for other large characters.

Therefore, perhaps this helps narrow down the problem.

+1
source

All Articles