Native Extension Undefined symbols for architecture armv7: error

Z Zeeshan Pathan 3 years 7 months ago
3 0 0

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)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 it works fine

CONTACT
Can’t find what you’re looking for?