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.

wpercy
  • 9,636
  • 4
  • 33
  • 45
mos Miler
  • 81
  • 3

3 Answers3

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.

Lucas van Dongen
  • 9,328
  • 7
  • 39
  • 60
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.

khcpietro
  • 1,459
  • 2
  • 23
  • 42
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!!!

guru
  • 2,727
  • 3
  • 27
  • 39