Error in minwindef.h when moving from xcode to Visual Studio

I have been trying to get my application working on visual studio (it previously was built solely for xcode).

After fixing a lot of errors I am left with just one that occurs in 3 of my component class files and main.cpp:

C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\shared\minwindef.h(157,29): error C2632: ‘int’ followed by ‘int’ is illegal

I have no idea why this error is occurring,
Thanks

Are you perhaps defining a function “int min()” (or max()) someplace where windows.h is included? If so, could it be a clash between the function and the macro? Just a guess.

I’m using a setSize() for a documentWindow. Thats the only place I can think of where there could be something like that. All the component classes that this error is occurring in are actually owned by a document window at some point

Does VS provide more info in the Error or Output window than just that? Like what code of yours was being compiled that led eventually to this error? I forget how to look at that in Windows. On Mac, you can just click on the Report Navigator and expand the compile info for any of the .cpp files that lead to that error.

Something like what I suggested is pretty likely to be the problem. There exists min() and max() macros on Windows that use int as their type, and so expanding “int min() {…}” would result in “int int(…) {} {};”, and thus you’d have int followed by int.

What JUCE version, and what VS version are you using? (And are you exporting for the correct VST version?)

Here are some full errors:

C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\shared\minwindef.h(157,29): error C2632: ‘int’ followed by ‘int’ is illegal (compiling source file …\Source\Main.cpp)

C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\shared\minwindef.h(157,29): error C2632: ‘int’ followed by ‘int’ is illegal (compiling source file …\Source\AudioFileTable.cpp)

I believe I’m using JUCE 5.4, visual studio 2019. I am building an application so no vst

I meant exporting for the correct VS version (not VST), sorry.

Ah ok - and how would I check that?

If you have multiple exporters in Projucer, are you using the one that matches the VS version you’re using? If you don’t have multiple versions, what value is set in Windows Target Platform? (I think that’s in both the main Project settings, and in each Windows Exporter, but not positive.) The error lists 10.0.17763.0 as the Windows SDK version being used. Is that what your project/exporter settings say?

It says Windows Target Platform 10.0?

Open C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\shared\minwindef.h in your favorite text editor and look at line 157, where the error is happening. If you can’t figure out what is wrong, please share that line, with a few surrounding lines for context.

Sorted now - turned out to be a linking error