Hello World in VS Code (Windows)

Trying to get setup with VS Code. Also have several new programmers who I’d like to give some basics to (trying to setup HelloWorld.cpp, but I’m not even quite sure :smiley:

I got it going fine on OSX (thinking it is b/c you have to install clang with XCode), but can’t get it to compile on Windows. Most of the setups are suggesting having minw-64 installed…so maybe that is the solution, but I was trying to use the FRC toolchains install instead (was concerned both might cause other issues).

Below are my tasks.json and launch.json. A few unexpected things (for me at least). Build creates an a.out, which I worked on Mac, but was expecting a.exe for windows. I’ve played around a bunch with them…so don’t be shocked if there are some strange values…this was just the final iteration :slight_smile:

{
    "version": "2.0.0",
    "tasks": 
        {
            "label": "build HelloWorld",
            "type": "shell",
            "command": "C:\\frc\\bin\\arm-frc-linux-gnueabi-g++.exe",
            "args": 
                "-g",
                "HelloWorld.cpp"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}
{
    "version": "0.2.0",
    "configurations": 
        {
            "name": "(gdb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/a.exe",
            "args": ],
            "stopAtEntry": true,
            "cwd": "${workspaceFolder}",
            "environment": ],
            "externalConsole": false,
            "MIMode": "gdb",
            "miDebuggerPath": "C:\\frc\\bin\\arm-frc-linux-gnueabi-gdb.exe",
            "setupCommands": 
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        }
    ]
}

The FRC toolchain is a cross-compiler that compiles for the roborio. You need a windows compiler, like mingw.

Cool. That’s what I thought might be the case. Appreciate quick response.