XCode 5 archive builds - arrgh!

Something has happened to my XCode 5 system ... at some point in the past 24 hours, I've started getting link errors like this when I create Archive builds (note that normal, debug builds are fine!):

Undefined symbols for architecture x86_64: "non-virtual thunk to juce::MenuBarModel::applicationCommandInvoked(juce::ApplicationCommandTarget::InvocationInfo const&)", referenced from: vtable for ContentComp in myfile.o

I haven't a clue what has caused this - not nice! It was working fine yesterday!

Wondering if somehow related to http://stackoverflow.com/questions/18387333/xcode-custom-framework-strange-partial-linker-error ...?

Pete

I'm still on Xcode 4, but in my experience, "non-virtual thunk" errors usually mean you've mis-matched something. If a clean rebuild doesn't help, it could be that the same header is included in multiple cpp files with different settings that cause it to be parsed differently?

Hi Jules!
 

You won't believe this, but...

- the project builds fine in both Debug and Release modes - it is just Build -> Archive that fails!!!

Luckily, I found-out from a post on StackOverflow, that I could do this:

cd myappfolder
xcodebuild -scheme myproject archive

Somewhat amazingly ... that actually works!!!

Then, I can open the file in the Archives under XCode, and upload to iTunesConnect!

So - there is something wrong with XCode. :( Never mind - I have a work-around!

Best wishes,

 

Pete

 

The problem comes if I compile-in the Juce code into a static library.

That library is then linked-in to an application project (also using Juce).

Building that application project either for release, or for debug, from XCode is fine.

Building that application project *for archive* from XCode 5 gives the linker problems.

Building that application project *for archive* from the command line (using xcodebuild) ... and it all works!

 

Diagnosis: not sure - but there is something a bit problematic about some of the Juce virtual method overrides.

I wish I could get to the bottom of this one!

 

Pete

 

I have FINALLY found the solution to this problem that KEEPS ON occuring for me.


And the solution is: change the compiler settings for Optimization, from -Os to -O1.

 

Simple, eh?! :)


Best to all,

 

Pete