在xcode项目中使用了一个带有swift erorr 'map'文件的文件

时间:2023-01-13 20:23:35

I'm trying to add an SDK to my Xcode project. The SDK contains .a files and (headers) .h files. The headers are imported to my Bridging-Header file (successfully).

我正在向我的Xcode项目添加一个SDK。SDK包含一个文件和(header) .h文件。头文件被导入到我的连接头文件中(成功)。

In the headers there is an #include <map>

在头文件中有一个#include

When I run the project I get an

当我运行这个项目时,我得到了a

Erorr 'map' file not found

没有找到Erorr 'map'文件

When I cmd+click on it Xcode take me to The LLVM Compiler Infrastructure.

当我点击cmd+时,Xcode带我到LLVM编译器基础结构。

What is going wrong here?

这里出了什么问题?

I'm using Xcode Version 7.2 (7C68) with Swift 2.0.

我正在使用Xcode版本7.2 (7C68)和Swift 2.0。

2 个解决方案

#1


0  

Perhaps you're including C++ files? If so you should add a .mm extension to your implementation instead of .m.

也许您包含c++文件?如果是这样,您应该在实现中添加.mm扩展名,而不是.m。

Since you're using Swift you probably need to wrap the component in a Objective-C++ wrapper before you can use it in your project.

由于您正在使用Swift,所以在您的项目中使用组件之前,您可能需要将组件封装在objective - c++包装器中。

#2


0  

I had a exact same problem. However, I solved this problem by removing #include from Bridging-Header file.
I'm not an expert on C language family, but according to this answer, the header file seems to be already included before you include it on Bridging-Header file. In fact, Bridging-Header is only bridging Swift-Objective C, it's not relevant to Objective-C compile layer.

我也有同样的问题。但是,我通过从桥头文件中删除#include解决了这个问题。我不是C语言家族的专家,但是根据这个答案,在将头文件包含到桥头文件之前,头文件似乎已经包含在其中了。事实上,bridging - header只是连接速度目标C,它与Objective-C编译层无关。

#1


0  

Perhaps you're including C++ files? If so you should add a .mm extension to your implementation instead of .m.

也许您包含c++文件?如果是这样,您应该在实现中添加.mm扩展名,而不是.m。

Since you're using Swift you probably need to wrap the component in a Objective-C++ wrapper before you can use it in your project.

由于您正在使用Swift,所以在您的项目中使用组件之前,您可能需要将组件封装在objective - c++包装器中。

#2


0  

I had a exact same problem. However, I solved this problem by removing #include from Bridging-Header file.
I'm not an expert on C language family, but according to this answer, the header file seems to be already included before you include it on Bridging-Header file. In fact, Bridging-Header is only bridging Swift-Objective C, it's not relevant to Objective-C compile layer.

我也有同样的问题。但是,我通过从桥头文件中删除#include解决了这个问题。我不是C语言家族的专家,但是根据这个答案,在将头文件包含到桥头文件之前,头文件似乎已经包含在其中了。事实上,bridging - header只是连接速度目标C,它与Objective-C编译层无关。