在一个iOS项目中引入了单元测试,感觉项目间的依赖关系有些乱,就建了一个新的Project,再把原来的.h和.m加进去,编译时竟然出现“SenTestingKit/SenTestingKit.h: No such file or directory”错误,google后发现这个帖子是正解,但原文说的不太清楚,这里再仔细记录一下。

问题的原因,与单元测试有关的源文件添加到了不正确的Targets中,单元测试的Target与另外的主程序文件是属于不同的target的。

两种解决办法:

1:重新添加.h和.m文件,在弹出的对话框的底部有一个“Add to targets”选项,一定要选中那个与单元测试相对应的xxxTests项,重新编译。

2:找到Target的Build Phases设置,仔细检查Compile Sources里的文件清单,把与单元测试有关的.m文件从主程序清单中移除,加到xxxTests这个Target中,重新编译。

解决SenTestingKit/SenTestingKit.h: No such file or directory的更多相关文章

  1. linux e2fsprogs安装解决uuid/uuid.h: No such file or directory错误

    linux查看某个包是否安装    dpkg -l libuu*    用gcc编译发生nux 错误:fatal error: uuid/uuid.h: No such file or directo ...

  2. 解决SDL/SDL.h: No such file or directory

    我在使用SDL2的时候遇到始终找不到头文件的问题,到处百度然后我尝试使用#include<SDL2/SDL.h>编译通过了,那么我很显然我之前设置的环境变量应该是没有生效的,后面在返回来研 ...

  3. [转]pro*c/c++编译错误 ” error: sqlca.h: No such file or directory “ 的解决办法

    $ gcc -o test test.c 出现错误:error: sqlca.h: No such file or directory [解决方法]知道 sqlca.h 在 $ORACLE_HOME/ ...

  4. Ubuntu下 fatal error: Python.h: No such file or directory 解决方法

    参考: fatal error: Python.h: No such file or directory Ubuntu下 fatal error: Python.h: No such file or ...

  5. 解决 Boost安装:fatal error: bzlib.h: No such file or directory 问题

    参考: How to install all the boost development libraries? 解决 Boost安装:fatal error: bzlib.h: No such fil ...

  6. VS 2015 报错 " 'unistd.h': No such file or directory" 的解决办法

    使用 Visual Studio 2015 进行程序开发工作时,如果编译的是来自于Linux平台的源文件,该源文件可能会包含头文件 uninstd.h,这样会产生报错信息: "fatal e ...

  7. 在ubuntu中安装luci解决iwinfo.h No such file or directory问题

    问题: src/luci-bwc.c:35:20: fatal error: iwinfo.h: No such file or directorycompilation terminated.mak ...

  8. VS2012与VS2015同时安装用VS2012创建MFC程序时弹出编译错误”fatal error C1083: 无法打开包括文件:“mprapidef.h”: No such file or directory”的解决办法

    在WIndows 7操作系统上同时安装VS2012与VS2015并用VS2012创建MFC程序时弹出编译错误”fatal error C1083: 无法打开包括文件:“mprapidef.h”: No ...

  9. 解决Ubuntu16.04 fatal error: json/json.h: No such file or directory

    参考博客 错误产生 安装json-c库之后,根据GitHub上面的readme文件链接到json-c库时出现以下错误: SDMBNJson.h:9:23: fatal error: json/json ...

随机推荐

  1. Java比较器对数组,集合排序一

    数组排序非常简单,有前辈们的各种排序算法,再加上Java中强大的数组辅助类Arrays与集合辅助类Collections,使得排序变得非常简单,如果说结合比较器Comparator接口和Collato ...

  2. etc/ld.so.conf的使用说明

    这个文件记录了编译时使用的动态链接库的路径.默认情况下,编译器只会使用/lib和/usr/lib这两个目录下的库文件如果你安装了某些库,比如在安装gtk+-2.4.13时它会需要glib-2.0 &g ...

  3. Complete The Pattern #6 - Odd Ladder

    Complete The Pattern #6 - Odd Ladder Task: You have to write a function pattern which creates the fo ...

  4. Android开发之onClick事件的实现

    算是从2015年开始学习android开发,目前把onClick的事件实现写下来,记录下,以备参考. 实现button的点击功能,让textView显示一行文字,最简单的onClick事件. 直接贴代 ...

  5. poj 1850 code(组合数学)

    题目:http://poj.org/problem?id=1850 题意:按给定的规则给字母编号. 一个很简单的题目,但是却做了好久.................................. ...

  6. SQL Server中Delete语句表名不能用别名

    delete from TABLEA A where A.FIELD1=10        (ORACLE适用)delete TABLEA from TABLEA A where A.FIELD1=1 ...

  7. SQL Server AlwaysOn 和 ILB

    Narayan Annamalai 网络高级项目经理 自 2013 年 8 月起,Azure 基础结构服务开始支持 SQL ServerAlwaysOn 可用性组.Azure 服务的内部负载平衡 (I ...

  8. (七)学习MVC之CodeFirst迁移更新数据库

    1.首先在程序包管理控制台输入:enable-migrations -force ,然后回车: 问题1: The EntityFramework package is not installed on ...

  9. Asp.net mvc中整合autofac

    创建Asp.net MVC并引入Autofac 首先,创建一个MVC站点,为方便起见,选初始带HomeController和AccountController的那种.然后通过NuGet或到Autofa ...

  10. error MSB3027: Could not copy "xxx.dll" to "xxx.dll". Exceeded retry count of 10. Failed.

    错误提示内容: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3363,5): error MSB302 ...