Including external libaries

Hi all,

I’m working a project where i’d like to use the Rubberband timestretching library, but I am having trouble correctly including it the Projucer.

Suppose the main header file (RubberBandStretcher.h) to be included is in:
C:\SomeFolder\SomeJuceProject\Libraries\rubberband-1.8.1\rubberband\

And its source files (such as RubberBandStretcher.cpp) are in:
C:\SomeFolder\SomeJuceProject\Libraries\rubberband-1.8.1\src\

My initial instinct was to include the header path in the Projucer VS2017 exporter’s “Header search paths” and the source files path in “Extra library search paths” for each build target.

Evidently, this is not correct as I am getting the following error at link-time:
Error LNK2019 unresolved external symbol "public: __cdecl RubberBand::RubberBandStretcher::RubberBandStretcher(unsigned __int64,unsigned __int64,int,double,double)" (??0RubberBandStretcher@RubberBand@@QEAA@_K0HNN@Z) referenced in function "public: __cdecl PitchShifter::PitchShifter(struct juce::dsp::ProcessSpec &)" (??0PitchShifter@@QEAA@AEAUProcessSpec@dsp@juce@@@Z) Roth-VHS_VST C:\Users\Rothmann\Documents\PROJECTS\Development\Github\Roth-VHS\Builds\VisualStudio2017\Roth-VHS.lib(PitchShifter.obj)

This looks like I am not correctly locating the definitions in the source .cpp file. The RubberBandStretcher.h file shows up in visual studio under “External Dependencies”.

Does anyone here know or have some pointers for me on fixing this? :slight_smile:

1 Like

“Extra library search paths” can be used to help the linker find libraries, i.e. collection of already compiled object files. These library files usually end with the extension .a, or .lib.

In your case, you need to compile the source file, by adding it to the sources of your project.

1 Like

Ah, that makes sense - Thanks McMartin!

1 Like

Daniel, I know it’s been a while but have you resolved this problem? I’m using VS 2019 on windows and I’m getting same errors as you, I can’t get to know which files to put on Extra library search paths and Header search paths :S

I finally manage to link the library properly. First I have a mistake compiling the library for x64 and x86 when I just needed to compile for x64. That was important because despite I had the correct paths on the projucer it didn’t work. So after correcting that I just put the library name (rubberband-library.lib) on the exporter “External Libraries to Link” and then put the correct paths on the exporter debug section.

1 Like

For fuller context for the next generation of JUCE devs as of JUCE 7 you can find these settings here:
image

You can use the View drop down and select Show Exporters Panel and then select the configuration you’re interested in, seen above as Debug and Release.
image

1 Like