Can't compile audio plugin with code::blocks ide

juce 6.0.4. windows 7 64bit. Code::Blocks 20.03 with mingw.
getting errors on building:

Process terminated with status 1 (0 minute(s), 26 second(s))

In file included from D:\workspace\audio\JUCE\modules/juce_gui_basics/juce_gui_basics.cpp:257,
from D:\workspace\cprojects\test2\JuceLibraryCode\include_juce_gui_basics.cpp:8:
D:\workspace\audio\JUCE\modules/juce_gui_basics/native/juce_win32_FileChooser.cpp: In member function ‘bool juce::Win32NativeFileChooser::showDialog(IFileDialog&, bool) const’:
D:\workspace\audio\JUCE\modules/juce_gui_basics/native/juce_win32_FileChooser.cpp:172:9: error: ‘FILEOPENDIALOGOPTIONS’ was not declared in this scope
FILEOPENDIALOGOPTIONS flags = {};
^~~~~~~~~~~~~~~~~~~~~
D:\workspace\audio\JUCE\modules/juce_gui_basics/native/juce_win32_FileChooser.cpp:172:9: note: suggested alternative: ‘BINDINFO_OPTIONS’
FILEOPENDIALOGOPTIONS flags = {};
^~~~~~~~~~~~~~~~~~~~~
BINDINFO_OPTIONS
In file included from D:/workspace/CodeBlocks/MinGW/x86_64-w64-mingw32/include/winbase.h:2380,
from D:/workspace/CodeBlocks/MinGW/x86_64-w64-mingw32/include/windows.h:70,
from D:\workspace\audio\JUCE\modules/juce_core/native/juce_BasicNativeHeaders.h:145,
from D:\workspace\audio\JUCE\modules/juce_core/juce_core.h:196,
from D:\workspace\audio\JUCE\modules/juce_graphics/juce_graphics.h:57,
from D:\workspace\audio\JUCE\modules/juce_gui_basics/juce_gui_basics.h:56,
from D:\workspace\audio\JUCE\modules/juce_gui_basics/juce_gui_basics.cpp:45,
from D:\workspace\cprojects\test2\JuceLibraryCode\include_juce_gui_basics.cpp:8:
D:\workspace\audio\JUCE\modules/juce_gui_basics/native/juce_win32_FileChooser.cpp:174:21: error: invalid use of incomplete type ‘IFileDialog’ {aka ‘struct IFileDialog’}
if (FAILED (dialog.GetOptions (&flags)))
^~~~~~
In file included from D:/workspace/CodeBlocks/MinGW/x86_64-w64-mingw32/include/shlobj.h:124,
from D:\workspace\audio\JUCE\modules/juce_core/native/juce_BasicNativeHeaders.h:158,
from D:\workspace\audio\JUCE\modules/juce_core/juce_core.h:196,
from D:\workspace\audio\JUCE\modules/juce_graphics/juce_graphics.h:57,
from D:\workspace\audio\JUCE\modules/juce_gui_basics/juce_gui_basics.h:56,
from D:\workspace\audio\JUCE\modules/juce_gui_basics/juce_gui_basics.cpp:45,
from D:\workspace\cprojects\test2\JuceLibraryCode\include_juce_gui_basics.cpp:8:
D:/workspace/CodeBlocks/MinGW/x86_64-w64-mingw32/include/shobjidl.h:672:19: note: forward declaration of ‘IFileDialog’ {aka ‘struct IFileDialog’}
typedef interface IFileDialog IFileDialog;
^~~~~~~~~~~
In file included from D:/workspace/CodeBlocks/MinGW/x86_64-w64-mingw32/include/winbase.h:2380,
from D:/workspace/CodeBlocks/MinGW/x86_64-w64-mingw32/include/windows.h:70,
from D:\workspace\audio\JUCE\modules/juce_core/native/juce_BasicNativeHeaders.h:145,
from D:\workspace\audio\JUCE\modules/juce_core/juce_core.h:196,
from D:\workspace\audio\JUCE\modules/juce_graphics/juce_graphics.h:57,
from D:\workspace\audio\JUCE\modules/juce_gui_basics/juce_gui_basics.h:56,
from D:\workspace\audio\JUCE\modules/juce_gui_basics/juce_gui_basics.cpp:45,
from D:\workspace\cprojects\test2\JuceLibraryCode\include_juce_gui_basics.cpp:8:
D:\workspace\audio\JUCE\modules/juce_gui_basics/native/juce_win32_FileChooser.cpp:174:41: error: ‘flags’ was not declared in this scope
if (FAILED (dialog.GetOptions (&flags)))
^~~~~
D:\workspace\audio\JUCE\modules/juce_gui_basics/native/juce_win32_FileChooser.cpp:174:41: note: suggested alternative: ‘llabs’
In file included from D:\workspace\audio\JUCE\modules/juce_gui_basics/juce_gui_basics.cpp:257,
from D:\workspace\cprojects\test2\JuceLibraryCode\include_juce_gui_basics.cpp:8:
D:\workspace\audio\JUCE\modules/juce_gui_basics/native/juce_win32_FileChooser.cpp:177:33: error: ‘FILEOPENDIALOGOPTIONS’ is not a type
const auto setBit = (FILEOPENDIALOGOPTIONS& field, bool value, FILEOPENDIALOGOPTIONS option)
^~~~~~~~~~~~~~~~~~~~~
D:\workspace\audio\JUCE\modules/juce_gui_basics/native/juce_win32_FileChooser.cpp:177:75: error: ‘FILEOPENDIALOGOPTIONS’ is not a type
const auto setBit = (FILEOPENDIALOGOPTIONS& field, bool value, FILEOPENDIALOGOPTIONS option)
^~~~~~~~~~~~~~~~~~~~~
D:\workspace\audio\JUCE\modules/juce_gui_basics/native/juce_win32_FileChooser.cpp:185:17: error: ‘flags’ was not declared in this scope
setBit (flags, selectsDirectories, FOS_PICKFOLDERS);
^~~~~
D:\workspace\audio\JUCE\modules/juce_gui_basics/native/juce_win32_FileChooser.cpp:185:17: note: suggested alternative: ‘llabs’
setBit (flags, selectsDirectories, FOS_PICKFOLDERS);
^~~~~
llabs
D:\workspace\audio\JUCE\modules/juce_gui_basics/native/juce_win32_FileChooser.cpp:185:52: error: ‘FOS_PICKFOLDERS’ was not declared in this scope
setBit (flags, selectsDirectories, FOS_PICKFOLDERS);
^~~~~~~~~~~~~~~
D:\workspace\audio\JUCE\modules/juce_gui_basics/native/juce_win32_FileChooser.cpp:185:52: note: suggested alternative: ‘NMCII_FOLDERS’
setBit (flags, selectsDirectories, FOS_PICKFOLDERS);
^~~~~~~~~~~~~~~
NMCII_FOLDERS
D:\workspace\audio\JUCE\modules/juce_gui_basics/native/juce_win32_FileChooser.cpp:186:52: error: ‘FOS_OVERWRITEPROMPT’ was not declared in this scope
setBit (flags, warnAboutOverwrite, FOS_OVERWRITEPROMPT);
^~~~~~~~~~~~~~~~~~~
D:\workspace\audio\JUCE\modules/juce_gui_basics/native/juce_win32_FileChooser.cpp:186:52: note: suggested alternative: ‘OFN_OVERWRITEPROMPT’
setBit (flags, warnAboutOverwrite, FOS_OVERWRITEPROMPT);
^~~~~~~~~~~~~~~~~~~
OFN_OVERWRITEPROMPT
D:\workspace\audio\JUCE\modules/juce_gui_basics/native/juce_win32_FileChooser.cpp:187:52: error: ‘FOS_ALLOWMULTISELECT’ was not declared in this scope
setBit (flags, selectMultiple, FOS_ALLOWMULTISELECT);
^~~~~~~~~~~~~~~~~~~~
D:\workspace\audio\JUCE\modules/juce_gui_basics/native/juce_win32_FileChooser.cpp:187:52: note: suggested alternative: ‘OFN_ALLOWMULTISELECT’
setBit (flags, selectMultiple, FOS_ALLOWMULTISELECT);
^~~~~~~~~~~~~~~~~~~~
OFN_ALLOWMULTISELECT
D:\workspace\audio\JUCE\modules/juce_gui_basics/native/juce_win32_FileChooser.cpp:188:52: error: ‘FOS_FORCEPREVIEWPANEON’ was not declared in this scope
setBit (flags, customComponent != nullptr, FOS_FORCEPREVIEWPANEON);
^~~~~~~~~~~~~~~~~~~~~~
D:\workspace\audio\JUCE\modules/juce_gui_basics/native/juce_win32_FileChooser.cpp:188:52: note: suggested alternative: ‘OAIF_FORCE_REGISTRATION’
setBit (flags, customComponent != nullptr, FOS_FORCEPREVIEWPANEON);
^~~~~~~~~~~~~~~~~~~~~~
OAIF_FORCE_REGISTRATION
In file included from D:/workspace/CodeBlocks/MinGW/x86_64-w64-mingw32/include/winbase.h:2380,
from D:/workspace/CodeBlocks/MinGW/x86_64-w64-mingw32/include/windows.h:70,
from D:\workspace\audio\JUCE\modules/juce_core/native/juce_BasicNativeHeaders.h:145,
from D:\workspace\audio\JUCE\modules/juce_core/juce_core.h:196,
from D:\workspace\audio\JUCE\modules/juce_graphics/juce_graphics.h:57,
from D:\workspace\audio\JUCE\modules/juce_gui_basics/juce_gui_basics.h:56,
from D:\workspace\audio\JUCE\modules/juce_gui_basics/juce_gui_basics.cpp:45,
from D:\workspace\cprojects\test2\JuceLibraryCode\include_juce_gui_basics.cpp:8:
D:\workspace\audio\JUCE\modules/juce_gui_basics/native/juce_win32_FileChooser.cpp:190:21: error: invalid use of incomplete type ‘IFileDialog’ {aka ‘struct IFileDialog’}
if (FAILED (dialog.SetOptions (flags)) || FAILED (dialog.SetTitle (title.toUTF16())))
^~~~~~
In file included from D:/workspace/CodeBlocks/MinGW/x86_64-w64-mingw32/include/shlobj.h:124,
from D:\workspace\audio\JUCE\modules/juce_core/native/juce_BasicNativeHeaders.h:158,
from D:\workspace\audio\JUCE\modules/juce_core/juce_core.h:196,
from D:\workspace\audio\JUCE\modules/juce_graphics/juce_graphics.h:57,
from D:\workspace\audio\JUCE\modules/juce_gui_basics/juce_gui_basics.h:56,
from D:\workspace\audio\JUCE\modules/juce_gui_basics/juce_gui_basics.cpp:45,
from D:\workspace\cprojects\test2\JuceLibraryCode\include_juce_gui_basics.cpp:8:
D:/workspace/CodeBlocks/MinGW/x86_64-w64-mingw32/include/shobjidl.h:672:19: note: forward declaration of ‘IFileDialog’ {aka ‘struct IFileDialog’}
typedef interface IFileDialog IFileDialog;
^~~~~~~~~~~
In file included from D:/workspace/CodeBlocks/MinGW/x86_64-w64-mingw32/include/winbase.h:2380,
from D:/workspace/CodeBlocks/MinGW/x86_64-w64-mingw32/include/windows.h:70,
from D:\workspace\audio\JUCE\modules/juce_core/native/juce_BasicNativeHeaders.h:145,
from D:\workspace\audio\JUCE\modules/juce_core/juce_core.h:196,
from D:\workspace\audio\JUCE\modules/juce_graphics/juce_graphics.h:57,
from D:\workspace\audio\JUCE\modules/juce_gui_basics/juce_gui_basics.h:56,
from D:\workspace\audio\JUCE\modules/juce_gui_basics/juce_gui_basics.cpp:45,
from D:\workspace\cprojects\test2\JuceLibraryCode\include_juce_gui_basics.cpp:8:
D:\workspace\audio\JUCE\modules/juce_gui_basics/native/juce_win32_FileChooser.cpp:190:59: error: invalid use of incomplete type ‘IFileDialog’ {aka ‘struct IFileDialog’}
if (FAILED (dialog.SetOptions (flags)) || FAILED (dialog.SetTitle (title.toUTF16())))
^~~~~~
In file included from D:/workspace/CodeBlocks/MinGW/x86_64-w64-mingw32/include/shlobj.h:124,
from D:\workspace\audio\JUCE\modules/juce_core/native/juce_BasicNativeHeaders.h:158,
from D:\workspace\audio\JUCE\modules/juce_core/juce_core.h:196,
from D:\workspace\audio\JUCE\modules/juce_graphics/juce_graphics.h:57,
from D:\workspace\audio\JUCE\modules/juce_gui_basics/juce_gui_basics.h:56,
from D:\workspace\audio\JUCE\modules/juce_gui_basics/juce_gui_basics.cpp:45,
from D:\workspace\cprojects\test2\JuceLibraryCode\include_juce_gui_basics.cpp:8:
D:/workspace/CodeBlocks/MinGW/x86_64-w64-mingw32/include/shobjidl.h:672:19: note: forward declaration of ‘IFileDialog’ {aka ‘struct IFileDialog’}
typedef interface IFileDialog IFileDialog;
^~~~~~~~~~~
In file included from D:/workspace/CodeBlocks/MinGW/x86_64-w64-mingw32/include/winbase.h:2380,
from D:/workspace/CodeBlocks/MinGW/x86_64-w64-mingw32/include/windows.h:70,
from D:\workspace\audio\JUCE\modules/juce_core/native/juce_BasicNativeHeaders.h:145,
from D:\workspace\audio\JUCE\modules/juce_core/juce_core.h:196,
from D:\workspace\audio\JUCE\modules/juce_graphics/juce_graphics.h:57,
from D:\workspace\audio\JUCE\modules/juce_gui_basics/juce_gui_basics.h:56,
from D:\workspace\audio\JUCE\modules/juce_gui_basics/juce_gui_basics.cpp:45,
from D:\workspace\cprojects\test2\JuceLibraryCode\include_juce_gui_basics.cpp:8:
D:\workspace\audio\JUCE\modules/juce_gui_basics/native/juce_win32_FileChooser.cpp:205:40: error: invalid use of incomplete type ‘IFileDialog’ {aka ‘struct IFileDialog’}
if (item == nullptr || FAILED (dialog.SetFolder (item)))
^~~~~~
In file included from D:/workspace/CodeBlocks/MinGW/x86_64-w64-mingw32/include/shlobj.h:124,
from D:\workspace\audio\JUCE\modules/juce_core/native/juce_BasicNativeHeaders.h:158,
from D:\workspace\audio\JUCE\modules/juce_core/juce_core.h:196,
from D:\workspace\audio\JUCE\modules/juce_graphics/juce_graphics.h:57,
from D:\workspace\audio\JUCE\modules/juce_gui_basics/juce_gui_basics.h:56,
from D:\workspace\audio\JUCE\modules/juce_gui_basics/juce_gui_basics.cpp:45,
from D:\workspace\cprojects\test2\JuceLibraryCode\include_juce_gui_basics.cpp:8:
D:/workspace/CodeBlocks/MinGW/x86_64-w64-mingw32/include/shobjidl.h:672:19: note: forward declaration of ‘IFileDialog’ {aka ‘struct IFileDialog’}
typedef interface IFileDialog IFileDialog;
^~~~~~~~~~~
In file included from D:/workspace/CodeBlocks/MinGW/x86_64-w64-mingw32/include/winbase.h:2380,
from D:/workspace/CodeBlocks/MinGW/x86_64-w64-mingw32/include/windows.h:70,
from D:\workspace\audio\JUCE\modules/juce_core/native/juce_BasicNativeHeaders.h:145,
from D:\workspace\audio\JUCE\modules/juce_core/juce_core.h:196,
from D:\workspace\audio\JUCE\modules/juce_graphics/juce_graphics.h:57,
from D:\workspace\audio\JUCE\modules/juce_gui_basics/juce_gui_basics.h:56,
from D:\workspace\audio\JUCE\modules/juce_gui_basics/juce_gui_basics.cpp:45,
from D:\workspace\cprojects\test2\JuceLibraryCode\include_juce_gui_basics.cpp:8:
D:\workspace\audio\JUCE\modules/juce_gui_basics/native/juce_win32_FileChooser.cpp:210:21: error: invalid use of incomplete type ‘IFileDialog’ {aka ‘struct IFileDialog’}
if (FAILED (dialog.SetFileName (filename.toWideCharPointer())))
^~~~~~
In file included from D:/workspace/CodeBlocks/MinGW/x86_64-w64-mingw32/include/shlobj.h:124,
from D:\workspace\audio\JUCE\modules/juce_core/native/juce_BasicNativeHeaders.h:158,
from D:\workspace\audio\JUCE\modules/juce_core/juce_core.h:196,
from D:\workspace\audio\JUCE\modules/juce_graphics/juce_graphics.h:57,
from D:\workspace\audio\JUCE\modules/juce_gui_basics/juce_gui_basics.h:56,
from D:\workspace\audio\JUCE\modules/juce_gui_basics/juce_gui_basics.cpp:45,
from D:\workspace\cprojects\test2\JuceLibraryCode\include_juce_gui_basics.cpp:8:
D:/workspace/CodeBlocks/MinGW/x86_64-w64-mingw32/include/shobjidl.h:672:19: note: forward declaration of ‘IFileDialog’ {aka ‘struct IFileDialog’}
typedef interface IFileDialog IFileDialog;
^~~~~~~~~~~
In file included from D:/workspace/CodeBlocks/MinGW/x86_64-w64-mingw32/include/winbase.h:2380,
from D:/workspace/CodeBlocks/MinGW/x86_64-w64-mingw32/include/windows.h:70,
from D:\workspace\audio\JUCE\modules/juce_core/native/juce_BasicNativeHeaders.h:145,
from D:\workspace\audio\JUCE\modules/juce_core/juce_core.h:196,
from D:\workspace\audio\JUCE\modules/juce_graphics/juce_graphics.h:57,
from D:\workspace\audio\JUCE\modules/juce_gui_basics/juce_gui_basics.h:56,
from D:\workspace\audio\JUCE\modules/juce_gui_basics/juce_gui_basics.cpp:45,
from D:\workspace\cprojects\test2\JuceLibraryCode\include_juce_gui_basics.cpp:8:
D:\workspace\audio\JUCE\modules/juce_gui_basics/native/juce_win32_FileChooser.cpp:215:47: error: invalid use of incomplete type ‘IFileDialog’ {aka ‘struct IFileDialog’}
if (extension.isNotEmpty() && FAILED (dialog.SetDefaultExtension (extension.toWideCharPointer())))
^~~~~~
In file included from D:/workspace/CodeBlocks/MinGW/x86_64-w64-mingw32/include/shlobj.h:124,
from D:\workspace\audio\JUCE\modules/juce_core/native/juce_BasicNativeHeaders.h:158,
from D:\workspace\audio\JUCE\modules/juce_core/juce_core.h:196,
from D:\workspace\audio\JUCE\modules/juce_graphics/juce_graphics.h:57,
from D:\workspace\audio\JUCE\modules/juce_gui_basics/juce_gui_basics.h:56,
from D:\workspace\audio\JUCE\modules/juce_gui_basics/juce_gui_basics.cpp:45,
from D:\workspace\cprojects\test2\JuceLibraryCode\include_juce_gui_basics.cpp:8:
D:/workspace/CodeBlocks/MinGW/x86_64-w64-mingw32/include/shobjidl.h:672:19: note: forward declaration of ‘IFileDialog’ {aka ‘struct IFileDialog’}
typedef interface IFileDialog IFileDialog;
^~~~~~~~~~~
In file included from D:/workspace/CodeBlocks/MinGW/x86_64-w64-mingw32/include/winbase.h:2380,
from D:/workspace/CodeBlocks/MinGW/x86_64-w64-mingw32/include/windows.h:70,
from D:\workspace\audio\JUCE\modules/juce_core/native/juce_BasicNativeHeaders.h:145,
from D:\workspace\audio\JUCE\modules/juce_core/juce_core.h:196,
from D:\workspace\audio\JUCE\modules/juce_graphics/juce_graphics.h:57,
from D:\workspace\audio\JUCE\modules/juce_gui_basics/juce_gui_basics.h:56,
from D:\workspace\audio\JUCE\modules/juce_gui_basics/juce_gui_basics.cpp:45,
from D:\workspace\cprojects\test2\JuceLibraryCode\include_juce_gui_basics.cpp:8:
D:\workspace\audio\JUCE\modules/juce_gui_basics/native/juce_win32_FileChooser.cpp:220:45: error: invalid use of incomplete type ‘IFileDialog’ {aka ‘struct IFileDialog’}
if (! selectsDirectories && FAILED (dialog.SetFileTypes (numElementsInArray (spec), spec)))

more errors now shown (char limit on forum posts)

The last time I saw somebody trying to use Codeblocks with JUCE, he gave up and switched to Visual Studio.

I would also recommend using Visual Studio on Windows (the Community edition is free). It will be a smoother experience as far as JUCE is concerned (in addition to being a better overall IDE, imo).

unfortunately, vs is not an option for me. i though codeblocks is one of supported ide’s. can anyone who knows c++ look into those errors, please?

I recently made a change which solved a very similar issue: https://github.com/juce-framework/JUCE/commit/6e02c45d3736d97601c2fa070c6a301753df2bb0

Please can you try building against the develop branch from the github repo and see whether that resolves the problem?