Build issue with latest git


#1

I just updated to the latest (my previous version was the 1.52 stable release) and I am getting several unresolved externals. For example…

error LNK2001: unresolved external symbol “public: virtual void __thiscall juce::TextEditor::Listener::textEditorTextChanged(class juce::TextEditor &)” (?textEditorTextChanged@Listener@TextEditor@juce@@UAEXAAV23@@Z)
error LNK2001: unresolved external symbol “public: virtual void __thiscall juce::TextEditor::Listener::textEditorReturnKeyPressed(class juce::TextEditor &)” (?textEditorReturnKeyPressed@Listener@TextEditor@juce@@UAEXAAV23@@Z)

Seems the unresolved externals are all new virtual functions that have a default implementation. Somehow, the linker is not resolving those to the default implementation. Any ideas?


#2

No idea how you’d manage to get that! Those are all just defined in the TextEditor code. Perhaps you’re including the wrong version of the headers, and building against some mis-matched cpps?


#3

I suspected something like that as well, so to be sure I completely replaced my previous juce folder with only contents from the latest git release and the same results. Double checking I see the following in the juce_TextEditor.h…

    class JUCE_API  Listener
    {
    public:
        /** Destructor. */
        virtual ~Listener()  {}

        /** Called when the user changes the text in some way. */
        virtual void textEditorTextChanged (TextEditor& editor);

        /** Called when the user presses the return key. */
        virtual void textEditorReturnKeyPressed (TextEditor& editor);

        /** Called when the user presses the escape key. */
        virtual void textEditorEscapeKeyPressed (TextEditor& editor);

        /** Called when the text editor loses focus. */
        virtual void textEditorFocusLost (TextEditor& editor);
    };

and see the following in the cpp…

void TextEditor::Listener::textEditorTextChanged (TextEditor&) {}
void TextEditor::Listener::textEditorReturnKeyPressed (TextEditor&) {}
void TextEditor::Listener::textEditorEscapeKeyPressed (TextEditor&) {}
void TextEditor::Listener::textEditorFocusLost (TextEditor&) {}

Not sure how that doesn’t resolve!!! I certainly am puzzled.


#4

Sorry, no idea!

If it was me, I’d try typing some junk characters into that cpp file, just to find out whether the compiler’s really reading it or not.


#5

Yeah, tried that and it definitely breaks the compile, so at least I know I have the right file. We have been using Juce for a while in this development (great library, by the way) so it’s not it’s even a new project/solution. Never seen anything like this issue before. Weird.

Anyway, thanks Jules. I’ll keep digging and post a solution when I find it just in case anyone else sees a similar issue.


#6

Resolved when I moved to the amalgamated code. I tend to think (well, strongly think) that it was something wrong in my Solution that I fixed when moving to the amalgamated code.