I use juce.dll 2.0,do a app,but the complier report :"error C2535: “void *juce::HeapBlock<ElementType,throwOnFailure>::operator new(size_t)”
Are you trying to call “new HeapBlock” somewhere!? I deliberately added the JUCE_PREVENT_HEAP_ALLOCATION to the class to prevent silliness like that.
BTW, if you’re trying to use it as a DLL, you should get the very latest version from GIT, because I added some DLL fixes last week.
I just got the latest viersion of modules.rebuild juce.dll.the app demo is generated by introjucer,i don’t do anything other change.
[quote=“jules”]Are you trying to call “new HeapBlock” somewhere!? I deliberately added the JUCE_PREVENT_HEAP_ALLOCATION to the class to prevent silliness like that.
BTW, if you’re trying to use it as a DLL, you should get the very latest version from GIT, because I added some DLL fixes last week.[/quote]
I didn’t call “new HeapBlock” anywhere,i just got the latest version,but the compiler still report ::error C2535: “void *juce::HeapBlock<ElementType,throwOnFailure>::operator new(size_t)”: redefinition. this trouble In my hair a few days.
This is due to newly added macro JUCE_PREVENT_HEAP_ALLOCATION in HeapBlock class template. This macro disallows object creation on heap by declaring new and delete operators in private scope. HeapBlock also has JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR, which already defines new and delete operators for windows dll configuration. I guess you can use JUCE_DECLARE_NON_COPYABLE instead of JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR in HeapBlock.
In the latest version it already uses JUCE_DECLARE_NON_COPYABLE.