1

As I'm not allowed to add an answer to several duplicated questions, I will ask this question and give also one answer ;-)

The undefined symbol was a call to a self written swift function. This function sits in an swift file with only "global" functions (no class in that file). The function is called from several classes and all was good until this morning.

Suddenly I got this link-error message when producing the release product. The funny think was, it was only for ONE function call. All other calls got no errors, and when I commented out this particular function call, all was good. And this function is a very easy one. There is only one function parameter (Int64) and it returns a CLocationCoordinate2D.

I checked all possible solutions found here and at other places in the web. I even copied the function 1:1 as a local function inside the class.. nothing worked.

The final solution was the compiler flag for optimization. For release builds the flag in "Swift Compiler - Code Generation" is set to "Fast, Whole Module Optimization".

After changing that to "Fast, Single Module Optimization", everything worked ...

I think it is simply a bug in the optimization engine.

.. maybe that will help others in similar situations.

Hardy_Germany
  • 1,259
  • 13
  • 19
  • I had this same issue and found the fix that you did. I would recommend answering your own question in the answer section instead of in the question. – Kenny Bambridge Jun 06 '17 at 04:02
  • 1
    Yes, you are right. At the time I wrote this, my "reputation ranking" was not high enough to answer questions (even my own ;-)).. will rewrite it later.. thanks for the feedback. – Hardy_Germany Jun 08 '17 at 21:37
  • Ahh I didn't realize that was a constraint. Thanks for explaining! – Kenny Bambridge Jun 09 '17 at 19:43

0 Answers0