views:

115

answers:

1

Hi,

I'm trying to do some Unit Testing on method that includes SQL call wrapped by FMDB. I get a lot of linker errors when i try to build the project such as these ones :

  "_sqlite3_step", referenced from:
      -[FMResultSet next] in FMResultSet.o
      -[FMDatabase executeUpdate:arguments:] in FMDatabase.o
  "_sqlite3_column_name", referenced from:
      -[FMResultSet setupColumnNames] in FMResultSet.o
      -[FMResultSet kvcMagic:] in FMResultSet.o

(there are 27 of them so i wont paste them all ;)

Everything works fine when my project is my active target, but when i set the target to the unit test bundle and add all the .m files to the target, then i get these errors.

Does anybody has any idea where the problem could come from ?

Thanks in advance, Vincent.

+1  A: 

Your Unit Tests target needs to include sqlite3.c.

That should fix it.

BJ Homer
Yes indeed that was the problem !I'm new to Xcode and i just began to understand how target and dependencies work.Thanks a lot !