Configuring Visual Studio Code to Cross compile with GCC


There are a number of pre-requistes steps :
1. Clone and Make bebbos Git repo.
2. Add to Path & VBCC environment vars.
3. Download the NDK.
4. Create a new folder & open it with VSC.
5. Create a new file for your code:

#include <exec/types.h>
#include <stdio.h>

void main()
{
   printf("hello world!\n");
}

                
6. Install the C++ extension for Visual Studio Code :
VSC C++ extension


7. Create or let VSC code create a c_cpp_properties.json file:
{
    "configurations": [
     {
            "name": "Amiga X-compile",
            "includePath": [
                "${workspaceFolder}/**",
                "C:\\amiga-gcc\\m68k-amigaos\\NDK39\\NDK_3.9\\Include\\include_h"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "compilerPath": "C:/amiga-gcc/bin/m68k-amigaos-gcc.exe",

            "intelliSenseMode": "gcc-x64"
        }
    ],
    "version": 4
}

8. Create or let VSC code create a tasks.json file:
{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "echo",
            "type": "shell",
            "command": "m68k-amigaos-gcc ${file} -o ${fileBasenameNoExtension} -Os -noixemul",
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}