0 Replies Latest reply on Feb 16, 2015 4:44 AM by Zeeshan Pathan

    Native Extension Undefined symbols for architecture armv7: error

    Zeeshan Pathan

      I'm trying to build a native extension for iphone named it changer

       

      I ran the rhodes extension changer command

      then changed the changer.xml file to add my method

      ran the api changer.xml command.

       

      Below is the code that i implemented

       

      -(void) change:(NSString*)expression valueFrom:(NSString*)valueFrom valueTo:(NSString*)valueTo append:(NSString*)append methodResult:(id<IMethodResult>)methodResult {

        char *token;

        char *newexpression=malloc([expression length]);

        /* get the first token*/

        token = strtok(strdup([expression UTF8String]), " ");

        while( token != NULL ) {

        char *p;

        if(p=strstr(token,[valueFrom UTF8String])) {

        sprintf(p, "%s%s%s", [valueTo UTF8String], p+[valueFrom length], [append UTF8String]);

        }

        strcat(newexpression, token);

        strcat(newexpression, " ");

        token = strtok(NULL, " ");

        }

        [methodResult setResult:[NSString stringWithUTF8String:newexpression]];

      }

       

      copied all the files from the generated/stub_impl folder to the impl folder

      now when i'm trying to make my ipa i get the below error message

      Undefined symbols for architecture armv7:

        "_Init_Changer_extension", referenced from:

            _Init_Extensions in librhorubylib.a(extensions.o)

      ld: symbol(s) not found for architecture armv7

      clang: error: linker command failed with exit code 1 (use -v to see invocation)

       

      I'm i missing some step. because if i try building with the code that the generator creates on rhodes extension <extension name> it works fine