Please help! Link error with JUCE


#1

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!


#2

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.


#3

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!