Build failure -- sq3lite undefined symbols

889 views
Skip to first unread message

Jeremy Bone

unread,
Feb 27, 2014, 6:16:59 PM2/27/14
to mobile-c...@googlegroups.com
After downloading and successfully building the iOS framework per the Github instructions (there's actually no "CBL iOS" scheme--the target is named that but the scheme appears to be called "Continuous iOS") and then adding it to my project, I get a host of undefined symbol errors related to sq3lite (included below) when building my project. I'm assuming they are related to the sqlite-unicodesn submodule, but have no idea why it's occurring.  Any ideas?  

ld: warning: directory not found for option '-L/Users/jeremy/Library/Developer/Xcode/DerivedData/Capillary-bkmtebennlvvbuaqjopogcdnpawu/Build/Products/Debug-iphoneos'
Undefined symbols for architecture armv7s:
  "_sqlite3_realloc", referenced from:
      _unicodeNext in CouchbaseLite(fts3_unicodesn.o)
      _unicodeAddExceptions in CouchbaseLite(fts3_unicodesn.o)
      _increase_size in CouchbaseLite(utilities_sq3.o)
  "_sqlite3_sql", referenced from:
      +[CBL_FMStatement explainQueryPlan:] in CouchbaseLite(FMDatabase.o)
  "_sqlite3_db_handle", referenced from:
      +[CBL_FMStatement explainQueryPlan:] in CouchbaseLite(FMDatabase.o)
  "_sqlite3_prepare_v2", referenced from:
      -[CBL_FMDatabase executeQuery:withArgumentsInArray:orVAList:] in CouchbaseLite(FMDatabase.o)
      -[CBL_FMDatabase executeUpdate:error:withArgumentsInArray:orVAList:] in CouchbaseLite(FMDatabase.o)
      +[CBL_FMStatement explainQueryPlan:] in CouchbaseLite(FMDatabase.o)
      _register_unicodesn_tokenizer in CouchbaseLite(sqlite3_unicodesn_tokenizer.o)
  "_sqlite3_bind_text", referenced from:
      _bindNSString in CouchbaseLite(FMDatabase.o)
      _register_unicodesn_tokenizer in CouchbaseLite(sqlite3_unicodesn_tokenizer.o)
  "_sqlite3_free", referenced from:
      +[CBL_FMStatement explainQueryPlan:] in CouchbaseLite(FMDatabase.o)
      _unicodeDestroy in CouchbaseLite(fts3_unicodesn.o)
      _unicodeOpen in CouchbaseLite(fts3_unicodesn.o)
      _unicodeClose in CouchbaseLite(fts3_unicodesn.o)
      _lose_s in CouchbaseLite(utilities_sq3.o)
  "_sqlite3_stmt_readonly", referenced from:
      -[CBL_FMDatabase executeQuery:withArgumentsInArray:orVAList:] in CouchbaseLite(FMDatabase.o)
      -[CBL_FMDatabase executeUpdate:error:withArgumentsInArray:orVAList:] in CouchbaseLite(FMDatabase.o)
  "_sqlite3_bind_int64", referenced from:
      -[CBL_FMDatabase bindObject:toColumn:inStatement:] in CouchbaseLite(FMDatabase.o)
  "_sqlite3_bind_blob", referenced from:
      -[CBL_FMDatabase bindObject:toColumn:inStatement:] in CouchbaseLite(FMDatabase.o)
      _register_unicodesn_tokenizer in CouchbaseLite(sqlite3_unicodesn_tokenizer.o)
  "_sqlite3_malloc", referenced from:
      _unicodeCreate in CouchbaseLite(fts3_unicodesn.o)
      _unicodeOpen in CouchbaseLite(fts3_unicodesn.o)
      _create_s in CouchbaseLite(utilities_sq3.o)
  "_sqlite3_bind_double", referenced from:
      -[CBL_FMDatabase bindObject:toColumn:inStatement:] in CouchbaseLite(FMDatabase.o)
  "_sqlite3_threadsafe", referenced from:
      +[CBL_FMDatabase isThreadSafe] in CouchbaseLite(FMDatabase.o)
  "_sqlite3_bind_null", referenced from:
      -[CBL_FMDatabase bindObject:toColumn:inStatement:] in CouchbaseLite(FMDatabase.o)
  "_sqlite3_create_collation", referenced from:
      -[CBLDatabase(Internal) openFMDB:] in CouchbaseLite(CBLDatabase+Internal.o)
  "_sqlite3_column_int64", referenced from:
      -[CBL_FMResultSet longForColumnIndex:] in CouchbaseLite(FMResultSet.o)
      -[CBL_FMResultSet longLongIntForColumnIndex:] in CouchbaseLite(FMResultSet.o)
  "_sqlite3_next_stmt", referenced from:
      -[CBL_FMDatabase close] in CouchbaseLite(FMDatabase.o)
  "_sqlite3_column_text", referenced from:
      -[CBL_FMResultSet stringForColumnIndex:] in CouchbaseLite(FMResultSet.o)
      +[CBL_FMStatement explainQueryPlan:] in CouchbaseLite(FMDatabase.o)
  "_sqlite3_value_blob", referenced from:
      _CBLComputeFTSRank in CouchbaseLite(CBLView+Internal.o)
  "_sqlite3_finalize", referenced from:
      -[CBL_FMDatabase close] in CouchbaseLite(FMDatabase.o)
      -[CBL_FMDatabase executeQuery:withArgumentsInArray:orVAList:] in CouchbaseLite(FMDatabase.o)
      -[CBL_FMDatabase executeUpdate:error:withArgumentsInArray:orVAList:] in CouchbaseLite(FMDatabase.o)
      -[CBL_FMStatement close] in CouchbaseLite(FMDatabase.o)
      +[CBL_FMStatement explainQueryPlan:] in CouchbaseLite(FMDatabase.o)
      _register_unicodesn_tokenizer in CouchbaseLite(sqlite3_unicodesn_tokenizer.o)
  "_sqlite3_reset", referenced from:
      -[CBL_FMDatabase executeUpdate:error:withArgumentsInArray:orVAList:] in CouchbaseLite(FMDatabase.o)
      -[CBL_FMStatement reset] in CouchbaseLite(FMDatabase.o)
  "_sqlite3_changes", referenced from:
      -[CBL_FMDatabase changes] in CouchbaseLite(FMDatabase.o)
  "_sqlite3_open_v2", referenced from:
      -[CBL_FMDatabase openWithFlags:] in CouchbaseLite(FMDatabase.o)
  "_sqlite3_column_bytes", referenced from:
      -[CBL_FMResultSet dataForColumnIndex:] in CouchbaseLite(FMResultSet.o)
      -[CBL_FMResultSet dataNoCopyForColumnIndex:] in CouchbaseLite(FMResultSet.o)
  "_sqlite3_busy_timeout", referenced from:
      -[CBL_FMDatabase openWithFlags:] in CouchbaseLite(FMDatabase.o)
      -[CBL_FMDatabase setBusyRetryTimeout:] in CouchbaseLite(FMDatabase.o)
  "_sqlite3_result_double", referenced from:
      _CBLComputeFTSRank in CouchbaseLite(CBLView+Internal.o)
  "_sqlite3_column_double", referenced from:
      -[CBL_FMResultSet doubleForColumnIndex:] in CouchbaseLite(FMResultSet.o)
  "_sqlite3_bind_int", referenced from:
      -[CBL_FMDatabase bindObject:toColumn:inStatement:] in CouchbaseLite(FMDatabase.o)
  "_sqlite3_column_name", referenced from:
      -[CBL_FMResultSet setupColumnNames] in CouchbaseLite(FMResultSet.o)
      -[CBL_FMResultSet columnNameForIndex:] in CouchbaseLite(FMResultSet.o)
  "_sqlite3_errcode", referenced from:
      -[CBL_FMDatabase lastErrorCode] in CouchbaseLite(FMDatabase.o)
  "_sqlite3_column_blob", referenced from:
      -[CBL_FMResultSet dataForColumnIndex:] in CouchbaseLite(FMResultSet.o)
      -[CBL_FMResultSet dataNoCopyForColumnIndex:] in CouchbaseLite(FMResultSet.o)
  "_sqlite3_step", referenced from:
      -[CBL_FMResultSet step] in CouchbaseLite(FMResultSet.o)
      -[CBL_FMDatabase executeUpdate:error:withArgumentsInArray:orVAList:] in CouchbaseLite(FMDatabase.o)
      +[CBL_FMStatement explainQueryPlan:] in CouchbaseLite(FMDatabase.o)
      _register_unicodesn_tokenizer in CouchbaseLite(sqlite3_unicodesn_tokenizer.o)
  "_sqlite3_errmsg", referenced from:
      -[CBL_FMResultSet step] in CouchbaseLite(FMResultSet.o)
      -[CBL_FMDatabase lastErrorMessage] in CouchbaseLite(FMDatabase.o)
      -[CBL_FMDatabase executeUpdate:error:withArgumentsInArray:orVAList:] in CouchbaseLite(FMDatabase.o)
  "_sqlite3_bind_parameter_count", referenced from:
      -[CBL_FMDatabase executeQuery:withArgumentsInArray:orVAList:] in CouchbaseLite(FMDatabase.o)
      -[CBL_FMDatabase executeUpdate:error:withArgumentsInArray:orVAList:] in CouchbaseLite(FMDatabase.o)
  "_sqlite3_libversion", referenced from:
      +[CBL_FMDatabase sqliteLibVersion] in CouchbaseLite(FMDatabase.o)
  "_sqlite3_last_insert_rowid", referenced from:
      -[CBL_FMDatabase lastInsertRowId] in CouchbaseLite(FMDatabase.o)
  "_sqlite3_mprintf", referenced from:
      +[CBL_FMStatement explainQueryPlan:] in CouchbaseLite(FMDatabase.o)
  "_sqlite3_close", referenced from:
      -[CBL_FMDatabase close] in CouchbaseLite(FMDatabase.o)
  "_sqlite3_column_type", referenced from:
      -[CBL_FMResultSet stringForColumnIndex:] in CouchbaseLite(FMResultSet.o)
      -[CBL_FMResultSet dataForColumnIndex:] in CouchbaseLite(FMResultSet.o)
      -[CBL_FMResultSet dataNoCopyForColumnIndex:] in CouchbaseLite(FMResultSet.o)
      -[CBL_FMResultSet objectForColumnIndex:] in CouchbaseLite(FMResultSet.o)
  "_sqlite3_column_count", referenced from:
      -[CBL_FMResultSet setupColumnNames] in CouchbaseLite(FMResultSet.o)
  "_sqlite3_column_int", referenced from:
      -[CBL_FMResultSet intForColumnIndex:] in CouchbaseLite(FMResultSet.o)
      +[CBL_FMStatement explainQueryPlan:] in CouchbaseLite(FMDatabase.o)
  "_sqlite3_create_function", referenced from:
      +[CBLView(Internal) registerFunctions:] in CouchbaseLite(CBLView+Internal.o)
ld: symbol(s) not found for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Jens Alfke

unread,
Feb 27, 2014, 7:03:42 PM2/27/14
to mobile-c...@googlegroups.com
On Feb 27, 2014, at 3:16 PM, Jeremy Bone <jer...@bonebox.org> wrote:

After downloading and successfully building the iOS framework per the Github instructions (there's actually no "CBL iOS" scheme--the target is named that but the scheme appears to be called "Continuous iOS”)

Hm, I fixed that in the wiki last week. Were you working from the summary in the readme itself? I just looked at it and it still has the wrong name. I’ll fix that.

and then adding it to my project, I get a host of undefined symbol errors related to sq3lite (included below) when building my project.

Did you remember to add the sqlite3 library to your app target? See step 3.1v in “Linking Couchbase Lite Into Your Own App”.

Also, for most users we recommend downloading the pre-built framework, to save the kind of trouble you’re running into. Unless you’re really into DIY or want to make sure you’re on the bleeding-edge master branch, it’s easier to avoid building it yourself.

—Jens
Reply all
Reply to author
Forward
0 new messages