Importing external libraries

Hello everyone, I’m having trouble including aubio source files into my JUCE project.

My project is in a folder called Project. Inside are the Source, Builds, JuceLibraryCode folders and the Project.jucer file, plus a Plugins folder inside of which the aubio-0.4.7 source files are located.

With that context out of the way, the essential header file to import is Project\Plugins\aubio-0.4.7\src\aubio.h, but I can’t manage to add the right path in the right field in the Projucer settings. I’ll dish some questions out so you can see where I’m having trouble… I know this has to be a simple task so bear with me :smiley:

Under Exporters -> Exporter -> Debug, do I add path\to\aubio.h to the Header Search Paths or the Extra Library Search Paths?

Under Exporters -> Exporter -> External Libraries to Link, should I also add aubio? aubio.h?

I want the path to the library be relative. Would it be Plugins\aubio-0.4.7\src? \Plugins\aubio-0.4.7\src? Does it matter if I use back-slashes or forward-slashes in the path?

It might be useful to mention I am on Windows using VS2017.

Any reason you don’t set the header path project wide, e.g. using the gear icon on the top left and enter the search path there so that it applies to all exporters? You should however link to the architecture specific library files (not the header) separately in each exporter. There was a thread a few days ago regarding adding libraries where I wrote a bit more on that topic, maybe the answer given there helps clearing up your issues too… Importing third party libraries in a Juce project

Thanks Penguin! Your post definitely helped. Now I’m pretty sure that I have to use a compiled version of aubio or compile it to import it.

What still isn’t clear to me is the relative path to put into the Projucer. I can import the header file successfully with a full path, however I am not getting results with relative paths. I’d appreciate a few simple examples, if possible.

With relative the standard question is: relative to what?
IIRC it is relative to the created project, so in Builds/MacOSX or BUILDS/VisualStudio2019 etc.
That means add …/…/ additionally to what you tried…

When doing all that for OSX, it will work that way on your machine, there will still be fun to do with otool -L and install_name_tool

You’re right about the path: it should be relative to the folder associated to the exporter at hand, e.g Project/Builds/VisualStudio2019/

Therefore, Project/Plugins/aubio/bin translates to ../../Plugins/aubio/bin

Thanks daniel!

I am trying to do this but I keep getting linker errors. @azohc Were you able to get this to work? We can’t really build this library on windows so we are stuck using the pre compiled libs.