相关疑难解决方法(0)

Swift框架:没有找到Umbrella标题'[...].h'

在包含Objective-CSwift代码的自定义框架中,Swift编译器抛出以下错误:

[build_path]/unextended-module.modulemap:2:19: error: umbrella header 'bugtest.h' not found
  umbrella header "bugtest.h"
                  ^
<unknown>:0: error: could not build Objective-C module 'bugtest'
Run Code Online (Sandbox Code Playgroud)

ios ios-frameworks swift

107
推荐指数
10
解决办法
5万
查看次数

使用Xcode 4(和依赖项)编译,构建或存档问题

这个问题在过去几周内已经发展,以涵盖更多一般性问题(以及从旧的升级项目).

然而,许多问题可以通过遵循相同的指令集来解决.

如果您遇到以下任何问题,请尝试接受的答案中的方法:

  • Xcode 4无法存档应用程序
  • Xcode 4创建了一个不可用的存档
  • Xcode 4不会创建.ipa
  • 由于预处理器错误,Xcode 4无法编译
  • Xcode 4找不到标题
  • Xcode 4的代码完成无效
  • 项目依赖性不会编译
  • 添加依赖性会导致上述任何问题

原始问题

标题:Xcode 4中的"未找到词法或预处理器问题文件"

我在Xcode 4中有一个项目,可以在设备和模拟器上运行良好,但在寻找与静态库关联的头文件时尝试归档它时出错:

In file included from /Volumes/Development/Path/LBProject/LBProject/LBProject-Prefix.pch:15:
In file included from /Volumes/Development/Path/LBProject/LBFDefines.h:23:
In file included from /Volumes/Development/Path/LBProject/Classes/LBProjectAppDelegate.h:11:
In file included from /Volumes/Development/Path/LBProject/LBProject/../FKNDirectory/FKNDirectoryManager.h:10:
/Volumes/Development/Path/LBProject/LBProject/../FKNDirectory/FKNDataModel.h:11:9: fatal error: 'Merchant.h' file not found [1]
 #import "Merchant.h"
         ^
1 error generated. 
Run Code Online (Sandbox Code Playgroud)

Xcode给出了错误

lexical or preprocessor issue file not found 
Run Code Online (Sandbox Code Playgroud)

很多谷歌搜索显示很多人都有这个问题,但没有解决方案.任何人都得到了修复甚至线索.

更新:user header搜索路径设置为${BUILT_PRODUCTS_DIR}所有配置.除了归档时,它使用任何配置构建良好.

更新2: Merchant.h …

compiler-construction objective-c clang xcode4 c-preprocessor

96
推荐指数
4
解决办法
8万
查看次数

Objective C to Swift包含多个目标的头文件

我通过import语句成功地从Objective C(针对目标'MyApp')调用我的Swift类:

#import "MyApp-Swift.h"
Run Code Online (Sandbox Code Playgroud)

我现在创建了一个名为"MyAppLite"的新目标

当我编译新目标时,我得到错误,因为代码需要"MyApp-Swift.h",但编译器正在创建"MyAppLite-Swift.h"

所以,我需要为#import我正在编译的目标创建一个条件Swift/ObjC头.

如何做到这一点,还是有更好的方法?

objective-c header-files target swift

64
推荐指数
5
解决办法
2万
查看次数