In the last couple of weeks we got several questions regarding Visual Studio 2022 and the API DevKit. If you try to use VS 2022 to build your AddOns, you have to keep in mind a few things.
First, Archicad 25 and Archicad 26 is built with the v142 toolset and AddOns are expected to be built with this version as well. It means, that to build Archicad AddOns with VS2022 first you have to install the v142 toolset manually (as the default is v143). You can do that by installing this component here:
Tools->Get tools and Features->Individual components
Here, check MSVC v142 - VS 2019 C++ x64/x86 build tools (v14.29-16.11) then click 'Modify'. Done!
Now, you have to specify the toolset used by the cmake project generator. You can do it by calling cmake with the following parameters:
cmake -T v142
Projects generated this way should compile without problems.