0

I'm trying to import a library of objective-c into swift. I've created a bridging file (a .h) and added it to the build settings, in Objective-C Bridging Header under Swift Compiler - General. Into the bridging file I've added #import <MyFramework>.

The problem comes now. This framework is private and particular. To install it correctly in Objective-C they told you to change the main.m to main.mm (which don't have sense in swift).

When I try to build the project I get 111 errors (Apple Mach-O linker error). It start with:

Undefined symbols for architecture x86_64:

And all the errors are similar to:

std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__grow_by(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long)", referenced from:

So I really don't understand it. Do you have any clue why is this happening?

If you need me to post some more information just tell me.

Thanks for the help.

1
  • @macroland I don't think so. I've used it in another project, in objective-C, and it worked correctly. Commented Aug 21, 2017 at 10:08

1 Answer 1

1

.mm extension is used for using c++ code .. std :: is c++ code. you just need to edit yourBridgingHeaderFile.m to YourBridingHeaderName.mm and you would be good to go

.mm file

Sign up to request clarification or add additional context in comments.

2 Comments

Ook, I was really lost on this. It work! Thanks for the help.
i am Glad that i helped :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.