Please help! Link error with JUCE

I am new to JUCE and I want to include JUCE library to another project so I can use the classes provided by JUCE elsewhere. I added the directories to the Additional Include Directories and included “JuceHeader.h” in my project. However, 2 errors occurred as follows:

Error LNK2001 unresolved external symbol "public: __thiscall juce::this_will_fail_to_link_if_some_of_your_compile_units_are_built_in_release_mode::this_will_fail_to_link_if_some_of_your_compile_units_are_built_in_release_mode(void)" (??0this_will_fail_to_link_if_some_of_your_compile_units_are_built_in_release_mode@juce@@QAE@XZ)

Error LNK1120 1 unresolved externals

There will be similar problems in Debug mode. I am using VS 2015 C++. Could anyone help me with this problem? Thanks in advance!

I’ve never come across that before, but it seems to explain what the problem is - Look for it in the Juce library, there’ll probably be a really handy comment just before it which explains what’s wrong.
Hint: https://github.com/julianstorer/JUCE/blob/master/modules/juce_core/juce_core.h
Have you tried cleaning all of the Juce build bits, and re building all in Release or Debug?
IMHO, easiest way to do this is delete (or rename/move) the JuceLibraryCode and Builds folders, and recreate them with Projucer and then do a full rebuild everything.

1 Like

I’ve figured out what the problem was. It seems I failed to link the module and it works after I redo it. Thanks for your help!

1 Like

I’m having the same issue. I’ve created Juce header files exactly like Projucer does but I’m still getting this link error. Any details of your setup you can share?
Thanks!

1 Like