Playground with a framework that links to a static library

I have a very simple Xcode 7 OS X workspace that includes a custom framework project (I called it MySQLKit) and a Swift playground. I can build the framework and use the public functions from the playground: very cool.


I'd like to include a static library in the framework (libmysqlclient.a in this case, but this problem occurs with seemingly any library).


As soon as I link the library into the framework, either through the "Link Binary With Libraries" build phase or through Other Linker Flags using -lmysqlclient, I start getting these errors in the playground:


Playground execution failed: error: Couldn't lookup symbols:

_MySQLKitVersionNumber

__TF8MySQLKit11testIntegerFT_Si


This happens regardless of whether I actually use any symbols from the static library: simply linking it into the framework seems to make the framework ununsable from the playground.


Not sure whether this is expected behaviour or a bug?

I posted an analogous question on Stack Overflow a few hours ago unaware of your post: http://stackoverflow.com/q/31590002/1409907


Have you found anything further about this?

I still haven't found a solution for this. Now at Xcode 7b4.

In Xcode 7b5 this is still an issue, but has changed. There is now a linker error when the playground compiles and tries to link against a Framework that is itself linked with the static library. This OpenRadar bug report describes the error pretty well:


https://openradar.appspot.com/22188625


The specific error message is:


ld: building for OSX, but linking in object file built for (unknown), file '(framework)' for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Playground with a framework that links to a static library
 
 
Q