Iphone Unit Test : with SQL

随声附和 提交于 2020-01-05 04:41:06

问题


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:


Your Unit Tests target needs to include sqlite3.c.

That should fix it.



来源:https://stackoverflow.com/questions/1188742/iphone-unit-test-with-sql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!