First try - IPlugInstrument the compilation errors

Hi,
I just downloaded IPlug2 from GitHub recently and tried to compile it with MSVS 19 under Win10.
The included example for IPlugInstrument does not compile for VST2 and produces following errors:
1>C:\iPlug2\IPlug\IPlug_include_in_plug_src.h(76,36): error C2672: ‘std::max’: no matching overloaded function found
1>C:\iPlug2\IPlug\IPlug_include_in_plug_src.h(76,62): error C2780: ‘_Ty std::max(std::initializer_list<_Elem>)’: expects 1 arguments - 2 provided
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.28919\include\utility(52): message : see declaration of ‘std::max’
1>C:\iPlug2\IPlug\IPlug_include_in_plug_src.h(76,62): error C2784: ‘_Ty std::max(std::initializer_list<_Elem>,_Pr)’: could not deduce template argument for ‘std::initializer_list<_Elem>’ from ‘VstInt32’
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.28919\include\utility(49): message : see declaration of ‘std::max’
1>C:\iPlug2\IPlug\IPlug_include_in_plug_src.h(76,62): error C2782: ‘const _Ty &std::max(const _Ty &,const _Ty &) noexcept()’: template parameter ‘_Ty’ is ambiguous

What I did wrong?

For VST3 it can not find included files (too many to list).

Thanks

Not sure why you are getting the min max problem.

Just made a new tutorial, if you follow the steps here, do you still get issues?

New tutorial is great. It builds VST3 plugin. But if I go to VST2 project then I got the same errors in compilation
1>C:\iPlug2\IPlug\IPlug_include_in_plug_src.h(76,36): error C2672: ‘std::max’: no matching overloaded function found
1>C:\iPlug2\IPlug\IPlug_include_in_plug_src.h(76,62): error C2780: ‘_Ty std::max(std::initializer_list<_Elem>)’: expects 1 arguments - 2 provided

pointing me out to this line in IPlug_include_in_plug_src.h

aEffect.numPrograms = std::max(aEffect.numPrograms, 1); // some hosts don’t like 0 presets

Have you modified the source code at all? I am able to compile VST2 without this min max error.

perhaps you could try putting

#undef min
#undef max

before #include “IPlug_include_in_plug_src.h” in the plugin .cpp file to see if that makes a difference

Thanks.It builds only if I put directly aEffect.numPrograms = 0;//
in “IPlug_include_in_plug_src.h”
It producess .dll but fails further to run bat:

CALL “C:\iPlug2\Examples\IPlugInstrument\scripts\postbuild-win.bat” “.dll” “IPlugInstrument” “Win32” “1” “C:\iPlug2\Examples\IPlugInstrument\build-win\vst2\Win32\Debug\IPlugInstrument.dll” “C:\Program Files (x86)\VstPlugins” “C:\Program Files\VstPlugins” “C:\Program Files (x86)\Common Files\VST3” “C:\Program Files\Common Files\VST3” “C:\Program Files (x86)\Common Files\Avid\Audio\Plug-Ins” “C:\Program Files\Common Files\Avid\Audio\Plug-Ins” “C:\iPlug2\Examples\IPlugInstrument\build-win” “C:\iPlug2\Examples\IPlugInstrument\projects…\Dependencies\IPlug\VST3_SDK\doc\artwork\VST_Logo_Steinberg.ico” “C:\iPlug2\Examples\IPlugInstrument\projects…\Dependencies\IPlug\AAX_SDK\Utilities\PlugIn.ico” “C:\iPlug2\Examples\IPlugInstrument\projects…\Scripts\create_bundle.bat”

You need to make sure your VST2 plugins folder is set correctly in common-win.props, and that you have write permissions

Ok, thanks… Otherwise, it is great !
I will check the compilation on MAC tonight.
Now it seems that anyone can do his own synth - a dream comes true)
A good thing and is not only.