Setlocal Error in VST Plugin: Process Function Code Causing Build Failure

Hello VST developers,

I’m encountering a peculiar issue with my VST plugin where the presence of specific code within the process function causes a setlocal error during the build process. I’ve been struggling to resolve this issue and would greatly appreciate any insights or suggestions from the community.

Problem Description: I’m developing a VST plugin using the VST SDK, and I’ve narrowed down the problem to a specific block of code within the process function of my plugin processor. When this code block is commented out, the plugin builds and runs perfectly without any issues. However, as soon as I uncomment the code block, the build process fails with a setlocal error.

The problematic code block is responsible for handling input parameter changes, applying audio processing effects (distortion, soft clipping, bitcrushing, frequency-dependent processing), and performing oversampling and downsampling. I’ve thoroughly reviewed the code and couldn’t find any obvious errors or issues that could cause the setlocal error.

To be clear, yesterday it was compiling perfectly fine. It is today, however, that this started happening.

Here’s a simplified version of the code block causing the issue:

if (data.inputParameterChanges)
{
    // Handle input parameter changes
    // ...
}

// Audio processing
for (int32 ch = 0; ch < numChannels; ch++)
{
    Vst::Sample32* pIn = in[ch];
    Vst::Sample32* pOut = out[ch];
    Vst::Sample32 tmp;

    for (int32 i = 0; i < oversampledNumSamples; i++) {
        // Apply audio processing effects
        // ...

        // Oversampling and downsampling
        // ...
    }

What I’ve Tried:

  • I’ve ensured that all the necessary dependencies and header files are properly included and linked in my project.
  • I’ve double-checked the parameter IDs used in the code and confirmed that they match the IDs used in the parameter registration.
  • I’ve granted all the necessary permissions to the project directories and files.
  • I’ve run Visual Studio in administrator mode to rule out any permission-related issues.
  • I’ve commented out different sections of the code block to isolate the problematic code, but the setlocal error persists whenever the code block is present.

I’ve been stuck on this issue for a while now and have exhausted all the troubleshooting steps I could think of. I would greatly appreciate any suggestions, insights, or experiences from fellow developers who may have encountered similar issues or have knowledge about resolving setlocal errors in VST plugin development.

If you need any further information or if there are specific details I should provide to aid in resolving this issue, please let me know. I’m eager to find a solution and move forward with my plugin development.

Thank you in advance for your time and assistance.