1 Reply Latest reply on May 17, 2012 12:57 AM by Maximist

    “ld: absolute addressing” ERROR when compile imported ane file inside new project in Flash Builder

    Maximist Level 1

      I'm coding an extension (ANE) for iPhone that read the contact list. I receive an error when add the .ane to my Flash Builder Project and compile it. I compiled the Objective-c code in a *.a lib without problems. I compiled the .ane without errors.

      This is the error when i add the .ane at the main Flex Project:

       

      Error occurred while packaging the application:

      ld
      : absolute addressing (perhaps -mdynamic-no-pic) used in _getContatti from
      /var/folders/j9/j9OzOTqhGJGpr2m87bnYEU+++TQ/-Tmp-/888e0e80-9ef5-4d2a-9e34-
      c01545b25bfc
      /mylib.library.com.a(ExtensionMyLibIOSNative.o) 
      not allowed in slidable image
      . Use '-read_only_relocs suppress' to enable text 
      relocs
      Compilation failed while executing : ld64

       

      In Xcode i have already set "Enable Linking With Shared Libraries" to "NO" in Build Settings. This is the Objective-c code that cause the error:

       

      FREObject getContatti(FREContext ctx, void* funcData, uint32_t argc, FREObject argv[]) {

      FREObject nome_visualizzato;
      FREObject nome_visualizzatoPrimario;
      FREObject nome_visualizzatoAlternativo;

      ABAddressBookRef addressBook = ABAddressBookCreate( );
      CFArrayRef allPeople = ABAddressBookCopyArrayOfAllPeople( addressBook );
      CFIndex nPeople = ABAddressBookGetPersonCount( addressBook );

      FREObject arrayContatti;
      FRENewObject((const uint8_t*)"Vector.<extension.MyLibrary.entity.Contatto>", 0, NULL, &arrayContatti, NULL);
      FRESetArrayLength(arrayContatti, nPeople);


      for ( int i = 0; i < nPeople; i++ )
      {
         
      ABRecordRef ref = CFArrayGetValueAtIndex( allPeople, i );
         
      CFStringRef first = ABRecordCopyValue(ref, kABPersonFirstNameProperty);
         
      CFStringRef last = ABRecordCopyValue(ref, kABPersonLastNameProperty);
         
      CFStringRef company = ABRecordCopyValue(ref, kABPersonOrganizationProperty);
         
      -- DO SOMETHING --
      }
         
      return result;
      }

       

       

      It works if i comment\remove the lines:

      CFStringRef first = ABRecordCopyValue(ref, kABPersonFirstNameProperty); 
      CFStringRef last = ABRecordCopyValue(ref, kABPersonLastNameProperty);
      CFStringRef company = ABRecordCopyValue(ref, kABPersonOrganizationProperty);

       

      I would apprecciate any kind of help.

       

      Thx

       

      Max