in xcode project using .a files with swift erorr 'map' file not found
Asked Answered
A

3

8

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).

In the headers there is an #include <map>

When I run the project I get an

Erorr 'map' file not found

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

What is going wrong here?

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

Accidence answered 28/1, 2016 at 15:53 Comment(2)
Hey were you able to resolve this ?Gawky
I also have the same issue, did you solve this?Anabel
S
1

Perhaps you're including C++ files? If so you should add a .mm extension to your implementation instead of .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.

Subclavius answered 8/2, 2017 at 19:40 Comment(0)
M
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.

Medin answered 22/3, 2018 at 8:6 Comment(0)
R
0

If you have any static libraries that depend on libstdc++.tbd you can try what i did.

Not sure if this is the case for you also, but i faced same error and after lot of research i fix it by:

Set CLANG_CXX_LIBRARY in build setting to ("C++ Standard Library") libc++ **OR** Compiler default

enter image description here

Actually Both work in my case. Hope it help someone.

Cheers!!!

Rosario answered 14/10, 2019 at 14:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.