2019 C++ VS Code will not compile with g++

Just installed FRC 2019 from scratch, following directions and using WPILib VS Code. When trying to build C++ robot code, g++ seems to be receiving Microsoft switches like /E and /D, and interpreting them as pathnames instead of switches (see below). We are unable to find any compiler commands in the workplace or user settings. Where/how can we fix this?
g++.exe: error: /EHsc: No such file or directory
g++.exe: error: /DNOMINMAX: No such file or directory
g++.exe: error: /Zi: No such file or directory
g++.exe: error: /FS: No such file or directory
g++.exe: error: /Zc:inline: No such file or directory
g++.exe: error: /Od: No such file or directory
g++.exe: error: /MDd: No such file or directory

Did you select the enableDesktopSupport checkbox when creating your project?

Also, what platform are you on?

Not sure about the DesktopSupport box. We imported an Eclipse project from 2018. It actually compiled just fine before the kickoff. It broke after the kickoff. The coding platform is a Dell laptop with Win64. Is that what you were asking?

Ok, you must have checked the desktop support icon in the importer. You can disable it by going into build.gradle, and there should be a line similar to enableDesktopSupport = true, set that to false.

It worked! I have no idea what DesktopSupport is, but I now get “BUILD SUCCESSFUL”! Thank you!

Starting this year, if you have Visual Studio 2017 installed (the full thing), you can actually build your code to run on the desktop, in addition to the roboRIO. In theory it should skip it if visual studio is not found, but occasionally it will glitch out and find some random desktop compiler on your system to try. So the default is disabled because of that, but whoever imported the project must have clicked the checkbox that enabled that support.

Thank you for the explanation. For now, my goal is simply to be able to deploy the code we write to the RoboRIO. Dual-use on the desktop can be a “stretch goal”. :slight_smile: Richard Daehler-Wilking

Sounds interesting. And it interfaces with the Driver Station? What are its limitations? Does it interface through the HAL, such that we could connect typical robot I/O devices into the laptop somehow?

I had this same problem. A WPILib person explained that VS Code includes a flag called “DesktopSupport”. With full Visual Studio (not just VS Code), you can get it to compile a version that will run on your laptop – which uses Microsoft compiler switches. In build.gradle for your project, you’ll see something like this:

// Set this to true to enable desktop support.
def includeDesktopSupport = false

If it says “= true”, you need to change it to “= false”.

(Blush!) I didn’t realize I was replying to my own question asked earlier!