Xcode单元测试构建错误“程序中的'意外'''' [英] Xcode Unit Test build error "Unexpected '@' in program"

查看:139
本文介绍了Xcode单元测试构建错误“程序中的'意外''''的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试构建单元测试(XCTest)并在几个文件中出现以下错误:

Trying to build a unit test (XCTest) and get the following error in several files:

@import Foundation; =======>程序中意外的'@'

@import Foundation; =======> Unexpected '@' in program

@import UIKit; =======>程序中意外的'@'

@import UIKit; =======> Unexpected '@' in program

(等等)

我做的没有得到常规版本的编译错误,只有单元测试。对我来说真正奇怪的是,生成错误的源文件甚至不是构建阶段中单元测试编译源的一部分! (单元测试不需要)

I do not get this compile error for the regular build, only unit tests. What seem really odd to me is that the source files that are generating the errors are not even part of the unit test Compile Sources in Build Phases! (not needed for unit testing)

有什么冲突?

推荐答案

<请检查您是否在测试目标构建设置中启用了启用模块。

Please check if you enabled "Enable Modules" in your test target build settings.

这篇关于Xcode单元测试构建错误“程序中的'意外''''的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆