Compile error VSTGUI 4.11

Can’t compile over here…

...vstgui4\vstgui\lib\platform\win32\win32directcomposition.cpp(785): error C2365: 'surface': redefinition; previous definition was 'data variable'
...vstgui4\vstgui\lib\platform\win32\win32directcomposition.cpp(785): note: see declaration of 'surface'
...vstgui4\vstgui\lib\platform\win32\win32directcomposition.cpp(786): error C3493: 'surface' cannot be implicitly captured because no default capture mode has been specified

Additionally, it doesn’t look like vstgui.lib is made, but perhaps that a result of the above issue?

A good practice to report such issues is to mention the toolchain you used to compile. So what compiler do you use?

I’m using Visual Studio 2022, but I also tried 2019. I didn’t change any settings in the VS projects. My c++ language is set to: ISO C++17 Standard (/std:c++17) .

You created the visual studio project via the include CMakeLists.txt?

That’s correct.

Hmm, on my machines, on the machines @ Steinberg and on GitHub is building the vstgui library successful. Can you post the full cmake and visual studio build output?

C:\Users\Moe Foe\OneDrive\coding\VST_3_7_5\build>cmake ../vst3sdk
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19043.
-- [SMTG] CMAKE_SOURCE_DIR is set to: C:/Users/Moe Foe/OneDrive/coding/VST_3_7_5/vst3sdk
-- [SMTG] CMAKE_CURRENT_LIST_DIR is set to: C:/Users/Moe Foe/OneDrive/coding/VST_3_7_5/vst3sdk
-- Could NOT find EXPAT (missing: EXPAT_LIBRARY EXPAT_INCLUDE_DIR)
-- VSTGUI will use the embedded Expat package!
-- [SMTG] SMTG_VSTGUI_ROOT is set to: C:/Users/Moe Foe/OneDrive/coding/VST_3_7_5/vst3sdk
-- [SMTG] SMTG_AAX_SDK_PATH is not set. If you need it, please download the AAX SDK!
-- [SMTG] SMTG_MYPLUGINS_SRC_PATH is not set. If you want to add your own Plug-ins folder, specify it!
-- [SMTG] Setup running moduleinfotool for adelay
-- [SMTG] Setup running validator for adelay
-- [SMTG] SMTG_PLUGIN_TARGET_PATH is set to: C:\Users\Moe Foe\AppData\Local\Programs\Common\VST3
-- [SMTG] Setup running moduleinfotool for again
-- [SMTG] Setup running validator for again
-- [SMTG] SMTG_PLUGIN_TARGET_PATH is set to: C:\Users\Moe Foe\AppData\Local\Programs\Common\VST3
-- [SMTG] Setup running moduleinfotool for againsimple
-- [SMTG] Setup running validator for againsimple
-- [SMTG] SMTG_PLUGIN_TARGET_PATH is set to: C:\Users\Moe Foe\AppData\Local\Programs\Common\VST3
-- [SMTG] Setup running moduleinfotool for again-sampleaccurate
-- [SMTG] Setup running validator for again-sampleaccurate
-- [SMTG] SMTG_PLUGIN_TARGET_PATH is set to: C:\Users\Moe Foe\AppData\Local\Programs\Common\VST3
-- [SMTG] Setup running moduleinfotool for channelcontext
-- [SMTG] Setup running validator for channelcontext
-- [SMTG] SMTG_PLUGIN_TARGET_PATH is set to: C:\Users\Moe Foe\AppData\Local\Programs\Common\VST3
-- [SMTG] Setup running moduleinfotool for hostchecker
-- [SMTG] Setup running validator for hostchecker
-- [SMTG] SMTG_PLUGIN_TARGET_PATH is set to: C:\Users\Moe Foe\AppData\Local\Programs\Common\VST3
-- [SMTG] Setup running moduleinfotool for legacymidiccout
-- [SMTG] Setup running validator for legacymidiccout
-- [SMTG] SMTG_PLUGIN_TARGET_PATH is set to: C:\Users\Moe Foe\AppData\Local\Programs\Common\VST3
-- [SMTG] Setup running moduleinfotool for mda-vst3
-- [SMTG] Setup running validator for mda-vst3
-- [SMTG] SMTG_PLUGIN_TARGET_PATH is set to: C:\Users\Moe Foe\AppData\Local\Programs\Common\VST3
-- [SMTG] Setup running moduleinfotool for multiple_programchanges
-- [SMTG] Setup running validator for multiple_programchanges
-- [SMTG] SMTG_PLUGIN_TARGET_PATH is set to: C:\Users\Moe Foe\AppData\Local\Programs\Common\VST3
-- [SMTG] Setup running moduleinfotool for noteexpressionsynth
-- [SMTG] Setup running validator for noteexpressionsynth
-- [SMTG] SMTG_PLUGIN_TARGET_PATH is set to: C:\Users\Moe Foe\AppData\Local\Programs\Common\VST3
-- [SMTG] Setup running moduleinfotool for noteexpressiontext
-- [SMTG] Setup running validator for noteexpressiontext
-- [SMTG] SMTG_PLUGIN_TARGET_PATH is set to: C:\Users\Moe Foe\AppData\Local\Programs\Common\VST3
-- [SMTG] Setup running moduleinfotool for panner
-- [SMTG] Setup running validator for panner
-- [SMTG] SMTG_PLUGIN_TARGET_PATH is set to: C:\Users\Moe Foe\AppData\Local\Programs\Common\VST3
-- [SMTG] Setup running moduleinfotool for pitchnames
-- [SMTG] Setup running validator for pitchnames
-- [SMTG] SMTG_PLUGIN_TARGET_PATH is set to: C:\Users\Moe Foe\AppData\Local\Programs\Common\VST3
-- [SMTG] Setup running moduleinfotool for prefetchable
-- [SMTG] Setup running validator for prefetchable
-- [SMTG] SMTG_PLUGIN_TARGET_PATH is set to: C:\Users\Moe Foe\AppData\Local\Programs\Common\VST3
-- [SMTG] Setup running moduleinfotool for programchange
-- [SMTG] Setup running validator for programchange
-- [SMTG] SMTG_PLUGIN_TARGET_PATH is set to: C:\Users\Moe Foe\AppData\Local\Programs\Common\VST3
-- [SMTG] Setup running moduleinfotool for syncdelay
-- [SMTG] Setup running validator for syncdelay
-- [SMTG] SMTG_PLUGIN_TARGET_PATH is set to: C:\Users\Moe Foe\AppData\Local\Programs\Common\VST3
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/Moe Foe/OneDrive/coding/VST_3_7_5/build

C:\Users\Moe Foe\OneDrive\coding\VST_3_7_5\build>

And here is the output from trying to build AGain.

1>------ Build started: Project: vstgui, Configuration: Debug x64 ------
1>win32directcomposition.cpp
1>C:\Users\Moe Foe\OneDrive\coding\VST_3_7_5\vst3sdk\vstgui4\vstgui\lib\platform\win32\win32directcomposition.cpp(785): error C2365: 'surface': redefinition; previous definition was 'data variable'
1>C:\Users\Moe Foe\OneDrive\coding\VST_3_7_5\vst3sdk\vstgui4\vstgui\lib\platform\win32\win32directcomposition.cpp(785): note: see declaration of 'surface'
1>C:\Users\Moe Foe\OneDrive\coding\VST_3_7_5\vst3sdk\vstgui4\vstgui\lib\platform\win32\win32directcomposition.cpp(786): error C3493: 'surface' cannot be implicitly captured because no default capture mode has been specified
1>Done building project "vstgui.vcxproj" -- FAILED.
2>------ Build started: Project: again, Configuration: Debug x64 ------
2>[SMTG] Copied resource/again.uidesc to C:/Users/Moe Foe/OneDrive/coding/VST_3_7_5/build/VST3/Debug/again.vst3/Contents/Resources
2>[SMTG] Copied resource/background.png to C:/Users/Moe Foe/OneDrive/coding/VST_3_7_5/build/VST3/Debug/again.vst3/Contents/Resources
2>[SMTG] Copied resource/slider_background.png to C:/Users/Moe Foe/OneDrive/coding/VST_3_7_5/build/VST3/Debug/again.vst3/Contents/Resources
2>[SMTG] Copied resource/slider_handle.png to C:/Users/Moe Foe/OneDrive/coding/VST_3_7_5/build/VST3/Debug/again.vst3/Contents/Resources
2>[SMTG] Copied resource/slider_handle_2.0x.png to C:/Users/Moe Foe/OneDrive/coding/VST_3_7_5/build/VST3/Debug/again.vst3/Contents/Resources
2>[SMTG] Copied resource/vu_on.png to C:/Users/Moe Foe/OneDrive/coding/VST_3_7_5/build/VST3/Debug/again.vst3/Contents/Resources
2>[SMTG] Copied resource/vu_off.png to C:/Users/Moe Foe/OneDrive/coding/VST_3_7_5/build/VST3/Debug/again.vst3/Contents/Resources
2>[SMTG] Copied resource/84E8DE5F92554F5396FAE4133C935A18_snapshot.png to C:/Users/Moe Foe/OneDrive/coding/VST_3_7_5/build/VST3/Debug/again.vst3/Contents/Resources/Snapshots
2>[SMTG] Copied resource/84E8DE5F92554F5396FAE4133C935A18_snapshot_2.0x.png to C:/Users/Moe Foe/OneDrive/coding/VST_3_7_5/build/VST3/Debug/again.vst3/Contents/Resources/Snapshots
2>[SMTG] Copied resource/41347FD6FED64094AFBB12B7DBA1D441_snapshot.png to C:/Users/Moe Foe/OneDrive/coding/VST_3_7_5/build/VST3/Debug/again.vst3/Contents/Resources/Snapshots
2>[SMTG] Copied resource/41347FD6FED64094AFBB12B7DBA1D441_snapshot_2.0x.png to C:/Users/Moe Foe/OneDrive/coding/VST_3_7_5/build/VST3/Debug/again.vst3/Contents/Resources/Snapshots
2>LINK : fatal error LNK1104: cannot open file '..\..\..\..\lib\Debug\vstgui.lib'
2>Done building project "again.vcxproj" -- FAILED.
========== Build: 0 succeeded, 2 failed, 10 up-to-date, 0 skipped ==========

Somehow I’m missing the important cmake output. If I run cmake the first lines look like this:

-- Building for: Visual Studio 17 2022
-- The C compiler identification is MSVC 19.32.31329.0
-- The CXX compiler identification is MSVC 19.32.31329.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done

Don’t you get this output?

I cleared my cache and ran cmake again. Maybe its because Windows SDK version 10.0.19043 doesn’t appear to be installed on my system?

C:\Users\Moe Foe\OneDrive\coding\VST_3_7_5\build>cmake -G "Visual Studio 16 2019" ../vst3sdk
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19043.
-- The C compiler identification is MSVC 19.20.27508.1
-- The CXX compiler identification is MSVC 19.20.27508.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.20.27508/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.20.27508/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- [SMTG] CMAKE_SOURCE_DIR is set to: C:/Users/Moe Foe/OneDrive/coding/VST_3_7_5/vst3sdk
-- [SMTG] CMAKE_CURRENT_LIST_DIR is set to: C:/Users/Moe Foe/OneDrive/coding/VST_3_7_5/vst3sdk
-- Could NOT find EXPAT (missing: EXPAT_LIBRARY EXPAT_INCLUDE_DIR)
-- VSTGUI will use the embedded Expat package!
-- [SMTG] SMTG_VSTGUI_ROOT is set to: C:/Users/Moe Foe/OneDrive/coding/VST_3_7_5/vst3sdk
-- [SMTG] SMTG_AAX_SDK_PATH is not set. If you need it, please download the AAX SDK!
-- Performing Test SMTG_USE_STDATOMIC_H
-- Performing Test SMTG_USE_STDATOMIC_H - Failed
-- [SMTG] SMTG_MYPLUGINS_SRC_PATH is not set. If you want to add your own Plug-ins folder, specify it!
-- [SMTG] Setup running moduleinfotool for adelay
-- [SMTG] Setup running validator for adelay
-- [SMTG] SMTG_PLUGIN_TARGET_PATH is set to: C:\Users\Moe Foe\AppData\Local\Programs\Common\VST3
-- [SMTG] Setup running moduleinfotool for again
-- [SMTG] Setup running validator for again
-- [SMTG] SMTG_PLUGIN_TARGET_PATH is set to: C:\Users\Moe Foe\AppData\Local\Programs\Common\VST3
-- [SMTG] Setup running moduleinfotool for againsimple
-- [SMTG] Setup running validator for againsimple
-- [SMTG] SMTG_PLUGIN_TARGET_PATH is set to: C:\Users\Moe Foe\AppData\Local\Programs\Common\VST3
-- [SMTG] Setup running moduleinfotool for again-sampleaccurate
-- [SMTG] Setup running validator for again-sampleaccurate
-- [SMTG] SMTG_PLUGIN_TARGET_PATH is set to: C:\Users\Moe Foe\AppData\Local\Programs\Common\VST3
-- [SMTG] Setup running moduleinfotool for channelcontext
-- [SMTG] Setup running validator for channelcontext
-- [SMTG] SMTG_PLUGIN_TARGET_PATH is set to: C:\Users\Moe Foe\AppData\Local\Programs\Common\VST3
-- [SMTG] Setup running moduleinfotool for hostchecker
-- [SMTG] Setup running validator for hostchecker
-- [SMTG] SMTG_PLUGIN_TARGET_PATH is set to: C:\Users\Moe Foe\AppData\Local\Programs\Common\VST3
-- [SMTG] Setup running moduleinfotool for legacymidiccout
-- [SMTG] Setup running validator for legacymidiccout
-- [SMTG] SMTG_PLUGIN_TARGET_PATH is set to: C:\Users\Moe Foe\AppData\Local\Programs\Common\VST3
-- [SMTG] Setup running moduleinfotool for mda-vst3
-- [SMTG] Setup running validator for mda-vst3
-- [SMTG] SMTG_PLUGIN_TARGET_PATH is set to: C:\Users\Moe Foe\AppData\Local\Programs\Common\VST3
-- [SMTG] Setup running moduleinfotool for multiple_programchanges
-- [SMTG] Setup running validator for multiple_programchanges
-- [SMTG] SMTG_PLUGIN_TARGET_PATH is set to: C:\Users\Moe Foe\AppData\Local\Programs\Common\VST3
-- [SMTG] Setup running moduleinfotool for noteexpressionsynth
-- [SMTG] Setup running validator for noteexpressionsynth
-- [SMTG] SMTG_PLUGIN_TARGET_PATH is set to: C:\Users\Moe Foe\AppData\Local\Programs\Common\VST3
-- [SMTG] Setup running moduleinfotool for noteexpressiontext
-- [SMTG] Setup running validator for noteexpressiontext
-- [SMTG] SMTG_PLUGIN_TARGET_PATH is set to: C:\Users\Moe Foe\AppData\Local\Programs\Common\VST3
-- [SMTG] Setup running moduleinfotool for panner
-- [SMTG] Setup running validator for panner
-- [SMTG] SMTG_PLUGIN_TARGET_PATH is set to: C:\Users\Moe Foe\AppData\Local\Programs\Common\VST3
-- [SMTG] Setup running moduleinfotool for pitchnames
-- [SMTG] Setup running validator for pitchnames
-- [SMTG] SMTG_PLUGIN_TARGET_PATH is set to: C:\Users\Moe Foe\AppData\Local\Programs\Common\VST3
-- [SMTG] Setup running moduleinfotool for prefetchable
-- [SMTG] Setup running validator for prefetchable
-- [SMTG] SMTG_PLUGIN_TARGET_PATH is set to: C:\Users\Moe Foe\AppData\Local\Programs\Common\VST3
-- [SMTG] Setup running moduleinfotool for programchange
-- [SMTG] Setup running validator for programchange
-- [SMTG] SMTG_PLUGIN_TARGET_PATH is set to: C:\Users\Moe Foe\AppData\Local\Programs\Common\VST3
-- [SMTG] Setup running moduleinfotool for syncdelay
-- [SMTG] Setup running validator for syncdelay
-- [SMTG] SMTG_PLUGIN_TARGET_PATH is set to: C:\Users\Moe Foe\AppData\Local\Programs\Common\VST3
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/Moe Foe/OneDrive/coding/VST_3_7_5/build

So I updated my Visual Studio install, deleted my CMakeCache.txt and ran cmake as follows:

cmake -G "Visual Studio 17 2022" ../vst3sdk

After that I was able to properly build vstgui.lib. So it seems like support for VS 2019 has issues.

And just for completeness. I cleared my CMakeCache again and tried to build for VS 2019 once more. And again, the compiler error from the original post pops up.

Are you on the latest version of VS 2019. Again, I’m able to build with the latest VS 2019.

I’m not familiar with using cmake with VS, but in general it’s a good idea to remove CMakeCache,txt when changing the arguments to cmake and regenerating the build environment. In a sandbox checked out from git, another option is to use “git clean” to remove files unknown to git, e.g., "git clean -fX’ or more extensive “git clean -dfX” I believe can remove all cmake generated files (see “git clean help”).

It’s quite possibly out of date. I’ll check tomorrow and let you know if updating does the trick.

Updated and now it works. Sorry for wasting your time.

I’m glad this is solved. But good to know when this pops up again.

Hello. I am newbie to Cmake and having some problems with compiling VSTGUI on Windows using Cmake. I use Visual Studio 22. I updated both Visual Studio and Cmake to latest version. I get this output from Cmake:

Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.22621.
The C compiler identification is MSVC 19.35.32217.1
The CXX compiler identification is MSVC 19.35.32217.1
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe - skipped
Detecting C compile features
Detecting C compile features - done
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe - skipped
Detecting CXX compile features
Detecting CXX compile features - done
Building only vstgui
Could NOT find EXPAT (missing: EXPAT_LIBRARY EXPAT_INCLUDE_DIR) 
VSTGUI will use the embedded Expat package!
Configuring done (5.7s)
Generating done (0.6s)

And this is the output from Visual Studio:

Build started...
1>------ Build started: Project: ZERO_CHECK, Configuration: Debug x64 ------
1>Checking Build System
2>------ Build started: Project: standalone, Configuration: Debug x64 ------
3>------ Build started: Project: simple_standalone, Configuration: Debug x64 ------
4>------ Build started: Project: mandelbrot, Configuration: Debug x64 ------
5>------ Build started: Project: Minesweeper, Configuration: Debug x64 ------
6>------ Build started: Project: ImageStitcher, Configuration: Debug x64 ------
7>------ Build started: Project: GFXTest, Configuration: Debug x64 ------
3>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(517,5): warning MSB8028: The intermediate directory (simple_standalone.dir\Debug\) contains files shared from another project (simple_standalone.vcxproj).  This can lead to incorrect clean and rebuild behavior.
4>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(517,5): warning MSB8028: The intermediate directory (vstgui_standalone.dir\Debug\) contains files shared from another project (vstgui_standalone.vcxproj).  This can lead to incorrect clean and rebuild behavior.
4>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(517,5): warning MSB8028: The intermediate directory (vstgui_uidescription.dir\Debug\) contains files shared from another project (vstgui_uidescription.vcxproj).  This can lead to incorrect clean and rebuild behavior.
4>Done building project "vstgui_standalone.vcxproj".
5>Minesweeper.vcxproj -> C:\vstgui-develop\vstgui-Builds\Debug\Minesweeper\Minesweeper.exe
4>mandelbrot.vcxproj -> C:\vstgui-develop\vstgui-Builds\Debug\mandelbrot\mandelbrot.exe
7>GFXTest.vcxproj -> C:\vstgui-develop\vstgui-Builds\Debug\GFXTest\GFXTest.exe
3>simple_standalone.vcxproj -> C:\vstgui-develop\vstgui-Builds\Debug\simple_standalone\simple_standalone.exe
6>ImageStitcher.vcxproj -> C:\vstgui-develop\vstgui-Builds\Debug\ImageStitcher\ImageStitcher.exe
2>AlertBoxDesign.cpp
2>testabout.cpp
3>Done building project "simple_standalone.vcxproj".
2>testappdelegate.cpp
2>testmodel.cpp
2>datepicker_win32.cpp
2>direct3dwindow.cpp
2>C:\Users\yetki\source\repos\vstgui-develop\vstgui\standalone\examples\standalone\source\direct3dwindow.cpp(514,4): error C2102: '&' requires l-value
2>C:\Users\yetki\source\repos\vstgui-develop\vstgui\standalone\examples\standalone\source\direct3dwindow.cpp(515,4): error C2102: '&' requires l-value
2>C:\Users\yetki\source\repos\vstgui-develop\vstgui\standalone\examples\standalone\source\direct3dwindow.cpp(592,38): error C2102: '&' requires l-value
2>C:\Users\yetki\source\repos\vstgui-develop\vstgui\standalone\examples\standalone\source\direct3dwindow.cpp(609,38): error C2102: '&' requires l-value
2>Done building project "standalone.vcxproj" -- FAILED.
8>------ Build started: Project: ALL_BUILD, Configuration: Debug x64 ------
8>Building Custom Rule C:/Users/yetki/source/repos/vstgui-develop/CMakeLists.txt
========== Build: 7 succeeded, 1 failed, 6 up-to-date, 0 skipped ==========
========== Build started at 4:48 PM and took 07,592 seconds ==========

This error slipped into the release by mistake. You can turn off building the VSTGUI Standalone examples for the moment (via the cmake variable “VSTGUI_STANDALONE_EXAMPLES”).

1 Like

Thanks

Hello all,
as I got a similar issue with VS2019, I made a few tests to try to understand where the problem can be.
I use VSTGUI version 4.13 (directly downloaded from Github, replacing the VSTGUI installed by default when you download the whole VST3 SDK from Steinberg’s developers resources)

For the tests below, I use the Project Generator to make an empty VST3 instrument with a GUI (not code added or modified, the plugin code is the one produced by VST3 Project Generator)

Test 1 :
VST3 Project Generator configured for VS2017 project, compilation under VS2017 → impossible to compile vstgui.lib, whatever I try to do, I always get the "
error C2365: ‘surface’: redefinition; previous definition was 'data variable"

Test 2 :
If I load the previous project under VS2019 : same problem with error C2375
If I clear CMake cache, problem still appears

Test 3:
I used VST3 Project Generator to create a completely clean empty project, but using “VS2019” as a target in the Project Generator
Result : the project now compiles properly under VS2019 and the plugin can be loaded in my VST3 host

Test 4 : same test as before, but under VS2022
Result: project also compiles properly (no C2375 error)

So, my conclusions are :

  • VSTGUI4 can not be compiled under VS2017 even if Project Generator target is set to VS2017
  • if you import a VS2017 project into VS2019, some files (probably the cache at least) must be deleted otherwise the error appears in VS2019 (even last version of VS2019)
  • it seems that the best solution is to make sure that Project Generator is set to VS2019 to create a empty default project, then load the project in VS2019 to be sure that it starts from a “clean” basis (same thing for VS2022)

Benoit