Thank you fabian.
Several reasons why I want to use dll:
- Size of my binary is around 150 Mb. I want to split this to modules.
- Compile takes forever, linking even longer
- I need to use 64bit toolchain otherwise linker runs out of memory
- I have some support utilities for my application that also use JUCE and same dll could be used.
I located problem and it is in “Toolbar::addDefaultItems” function. This function creates an array in one dll and items are added by factory which is in second dll.
HeapBlock::realloc is called which uses “std::malloc” instead of “juceDLL_malloc” and I believe this is wrong.
I fixed problem by not using “addDefaultItems”. Instead I use this function:
void AddToolbarItems(juce::ToolbarItemFactory& factory, juce::Toolbar& toolBar)
for (auto itemId : ids)
if (auto* tc = toolBar.createItem(factory, itemId))
I had to add insertToolbarItem to juce
void Toolbar::insertToolbarItem(ToolbarItemComponent* tc, int insertIndex)
Everything seems to work for now. I even managed to fix OpenGL issues that I was having.
I would love to get comment from ROLI regarding this issue. Am I correct that std::malloc inside HeapBlock is cause for this issue and can you do anything about this? If not then at least add “insertToolbarItem” to JUCE like I did. Thank you.