error building empty plugin in mingw msys

When i try to run the make command in msys with an empty plugin: i get this error:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\Hostx64\x64\cl.exe -std=c++11 -Wsuggest-override  -fPIC -I/c/Users/username/Documents/Rack-SDK-1.1.6/Rack-SDK/include -I/c/Users/username/Documents/Rack-SDK-1.1.6/Rack-SDK/dep/include -MMD -MP -g -O3 -march=nocona -funsafe-math-optimizations -Wall -Wextra -Wno-unused-parameter -DARCH_WIN -D_USE_MATH_DEFINES  -c -o build/src/plugin.cpp.o src/plugin.cpp
/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\Hostx64\x64\cl.exe -std=c++11 -Wsuggest-override  -fPIC -I/c/Users/username/Documents/Rack-SDK-1.1.6/Rack-SDK/include -I/c/Users/username/Documents/Rack-SDK-1.1.6/Rack-SDK/dep/include -MMD -MP -g -O3 -march=nocona -funsafe-math-optimizations -Wall -Wextra -Wno-unused-parameter -DARCH_WIN -D_USE_MATH_DEFINES  -c -o build/src/plugin.cpp.o src/plugin.cpp'
make: *** [/c/Users/username/Documents/Rack-SDK-1.1.6/Rack-SDK/ build/src/plugin.cpp.o] Error 1

Has anyone else ran into this? I must have something set up wrong but i thought i followed all the steps correctly, albeit i did that a few months back. It shouldn’t be using visual studio’s compiler, right?

Are you sure you are building from the MSYS console? It looks like you are compiling from a standard command prompt and using the Visual Studio 2019 compiling tools found in your PATH variable.

i am building from the msys console, is it using visual studio tools because i’m in the C drive?

I’m not sure why it is doing that. You did install all necessary packages for the build enviroment?

No, I make my plugins on the C drive, and use gcc from the command line to make plugins. Also use Visual Studio to build and debug my unit tests, but not from the MSYS2 command line. It all works with no special tinkering. I wonder why MSYS2 is even able to find Visual Studio. Did you (or someone else add visual studio to MSYS2’s path? I don’t think it’s in my path. Although I admit I’m not sure how everything gets there (the stuff I put there intentionally is in .bash_profile.)

echo $PATH will show your path.

i have the following stuff in path, does this look right?


it does. Notably I don’t see a path to visual studio. How could it be running from there?

Are you in the MinGW 64-bit shell? From the manual:


Install MSYS2 and launch the MinGW 64-bit shell from the Start menu, not the default MSYS shell.

i was using the mingw 64-bit shell as far as i could tell. maybe i need to reinstall mingw.

I figured out the problem, i had defined that windows environment variable for CXX to be the visual studio path because I was trying to work with visual studio earlier, deleting that allowed the make command to work. I guess the windows path variables override the msys shell variables.