Juce auto-linker in a static lib problem

Hi Jucers,

I have a static lib that i user in various projects which depends on juce,
and some applications (VST plugins, standalone applications) which depends on that static lib and on juce for their UI,
thus, juce is linked twice into the final executables,
which gives me lots of duplicate symbol problems for juce objects, in particular for objects related to hosting plugins.

The problem is that juce auto-link into my lib, which isnt really necessary. How do i prevent this?

and what is generally the recommendeed way to use static libs?

Your static library doesn’t need to be linked to juce, as long as your main app is.

That does mean the same library isn’t usable for juce based and non juce based projects - you’d need two libraries for that.


I don’t use static libraries anymore, the “unity build” style that Jules introduced in Juce 2.0 is superior. It’s a lot easier to just add one .cpp file than it is to fiddle with a bunch of compile and link options.