Undefined symbol in JuceDemoPlugin (AU)


#1

Using the latest 4.2 on Mac:

Undefined symbols for architecture i386:
“juce::repostCurrentNSEvent()”, referenced from:
JuceAUView::ComponentInHIView::keyPressed(juce::KeyPress const&) in juce_audio_plugin_client_AU_1.o
ld: symbol(s) not found for architecture i386


#3

The JuceDemoPlugin…


#4

Sorry, don’t get the same thing here, and really struggling to imagine how you could get that… Are you sure you’re building with all the right files?


#5

I’ve just created a fresh project with the new ProJucer, I can only assume everything is where it should be. Will do some more digging…


#6

The thing is, repostCurrentNSEvent is defined in juce_mac_MessageManager.mm. If it’s missing, then the entire event handling system must also be missing!


#7

It works when building a debug version, but not for release. I’d think this has something to do with stripping symbols but I’ve cycled through all Xcode strip settings, to no avail…


#8

I get the same problem now that I attempted a release build with Juce 4.2 for the first time.

Undefined symbols for architecture i386:
“juce::repostCurrentNSEvent()”, referenced from:
JuceAUView::ComponentInHIView::keyPressed(juce::KeyPress const&) in juce_audio_plugin_client_AU_1.o
ld: symbol(s) not found for architecture i386


#9

same here, happens in release mode only


#10

Note the symbol is only missing from the i386 build, not the x64. A debug i386 build does work. The error happens during the linking of the AU target.


#11

The problem is resolved by setting “Symbols hidden by Default” to NO for release builds. This and the other bug I encountered earlier with older SDKs makes me wonder about how much testing goes into major changes before they are pushed to JUCE git. It’s a bit worrysome as it looks like no real test builds are done while this could easily be automated.

This means the problem is that the method gets hidden during the release build. The true solution is to add attribute ((visibility(“default”))) or even better JUCE_API to line 360 of juce_mac_MessageManager.mm like so:

359: void repostCurrentNSEvent();
360: JUCE_API void repostCurrentNSEvent()
361: {
(…)


#12

Good find, thanks! Jeez, what about this 20 character minimum post length?


#13

pflugshaupt there is no testing of major changes, as always. we are supposed to test for them after they release to live.


#14

Hey, easy on the trolling there, of course we test things! But with a project like JUCE there are so many goddamned configurations that we can’t physically test everything, and a few problems will always slip through the net. This particular mistake would have been caught by the CI server that we didn’t have time to set-up before this release, but which we’ll definitely be adopting soon.

For the record, we’ve now fixed this, thanks for the heads-up, guys.


#15

jenkins is your friend here. you should probably use it for regression testing asap. there are no other way to ensure big changes will not break everything again and again.