SpokaneDude
SpokaneDude

Reputation: 4974

Build error: Undefined symbols for architecture i386?

I am getting this build error on an iPad app using XCode4 with Storyboards:

Undefined symbols for architecture i386: "_OBJC_CLASS_$_SQLite", referenced from: objc-class-ref in EnterDataViewController.o

I have looked everywhere that I know of in the app, done a clean and re-built all to no avail. I don't see what the error is talking about.

What is happening and how do I fix it?

UPDATE: here is the relevant code from EnterDataVewController.m

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//--  set First Responder
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- (BOOL) textFieldShouldReturn:(UITextField *)textField  {

    //  for site data...
    if(textField == txtSiteID)  {
        [txtSTA becomeFirstResponder];
        return true;
    }

    if(textField == txtSTA)  {
        [txtElev becomeFirstResponder];
        return true;
    }

    if(textField == txtElev)  {
        [txtSiteDesc becomeFirstResponder];
        return true;
    }

    if(txtSiteDesc.isFirstResponder)  { 
        SQLite *db = [[SQLite alloc] init];
        [db saveSiteData:(UITextField *) txtSiteID sta:(UITextField *) txtSTA desc:(UITextField *) txtSiteDesc elev: (UITextField *) txtElev ];
        [txtSiteDesc resignFirstResponder];
        return true;
    }

    //  for readings
    if(textField == txtSTA1)  {
        [txtBS becomeFirstResponder];
        return true;
    }

    if(textField == txtBS) {
        [txtFS becomeFirstResponder];
        return true;
    }

    if(textField == txtFS)  {
        [txtDesc becomeFirstResponder];
        return true;
    }

    //    if(textField.isFirstResponder) {  
    if(textField == txtDesc) {  
        SQLite *db = [[SQLite alloc] init];
        [db saveReadings:txtSiteID sta:txtSTA1 bs:txtBS fs:txtFS desc:txtDesc];
        [txtDesc resignFirstResponder];
        return true;
    }

    return YES;
}

//    //--  is this for txtDesc 
//    if(txtDesc.isFirstResponder)  {
//        [txtDesc resignFirstResponder];
//    }
//

NSString *databasePath;
NSString *docsDir;
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//--  save the site data
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- (BOOL) saveSiteData  {


    //  validate all fields
    if(txtSiteID.text.length == 0 || txtSiteDesc.text.length == 0)  {
        [self Alert:@"Missing Site ID and/or Description" andData:@"Reqired fields"];
        return NO;
    }

    if(txtSTA.text.length == 0 || txtElev.text.length == 0)  {
        [self Alert:@"Missing Initial STA and/or Elevation" andData:@"Reqired fields"];        
        return NO;
    }

    //    txtSiteDesc.text = txtSiteDesc.text.re  <----------  remove single quotes  TODO

    //  update d/b
    SQLite *dbCode = [[SQLite alloc] init];  //  instantiate slSQLite
    [dbCode saveSiteData:txtSiteID sta:txtSTA desc:txtSiteDesc elev:txtElev];  //  save site data

    return YES;
}


//++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//--  save the readings
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- (void) saveReadings  {

    //  update d/b
    SQLite *dbCode = [[SQLite alloc] init];  //  instantiate slSQLite
    [dbCode saveReadings:txtSiteID sta:txtSTA1 bs:txtBS fs:txtFS desc:txtDesc];

    return;
}

Upvotes: 0

Views: 396

Answers (2)

SpokaneDude
SpokaneDude

Reputation: 4974

I found the problem... there were two (2) instances of EnterDataVewController.m in separate directories in the same project. I don't know why that would cause the problem, but when I removed the second instance, it build without any issues (other than normal).

Thank you everybody for the suggestions. I do appreciate your time.

Upvotes: 1

MCKapur
MCKapur

Reputation: 9157

Is SQLite your own separate class... if so import it... if not try importing CoreData framework in

Upvotes: 0

Related Questions