QB64 Phoenix Edition
VS Code and Qb64 pe - Printable Version

+- QB64 Phoenix Edition (https://qb64phoenix.com/forum)
+-- Forum: Chatting and Socializing (https://qb64phoenix.com/forum/forumdisplay.php?fid=11)
+--- Forum: General Discussion (https://qb64phoenix.com/forum/forumdisplay.php?fid=2)
+--- Thread: VS Code and Qb64 pe (/showthread.php?tid=3902)



VS Code and Qb64 pe - Unseen Machine - 09-02-2025

I need some pointers/info on how to get it to actually compile a loaded project please....anyone got any ideas?

John


Code: (Select All)
qb64pe.exe : The term 'qb64pe.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path 
was included, verify that the path is correct and try again.
At line:1 char:1
+ qb64pe.exe -x 'C:\QB64\UnseenGDK_Dev\Projects\Cloth Simulation.bas' - ...
+ ~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (qb64pe.exe:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException



RE: VS Code and Qb64 pe - SMcNeill - 09-02-2025

Try:

./qb64pe.exe -x

Don't forget the ./


RE: VS Code and Qb64 pe - Unseen Machine - 09-02-2025

Forgive my ignorance, but where should i put that?


RE: VS Code and Qb64 pe - a740g - 09-03-2025

If you're using VS Code with QB64-PE, you might find the QB64-PE extension (https://open-vsx.org/extension/grymmjack/qb64pe) by @grymmjack helpful. Just thought I'd mention it since your topic title says, "VS Code and Qb64 pe".


RE: VS Code and Qb64 pe - dbox - 09-03-2025




RE: VS Code and Qb64 pe - grymmjack - 09-03-2025

More extensive help here too:
https://github.com/grymmjack/vscode-profiles/blob/main/QB64PE-2025/README.md


RE: VS Code and Qb64 pe - grymmjack - 09-03-2025

If you just want a light weight setup with no extension use this:

Create a .vscode directory in your workspace.
Create a tasks.json file within .vscode directory in the workspace.

Change this below:
Code: (Select All)
${config:qb64pe.compilerPath}

To the path where your QB64pe binary is, e.g.

Code: (Select All)
C:\QB64pe\qb64pe.exe

That's it, then hit CTRL-B and it will compile and show a little terminal window. Here you can see the warnings, etc.

Tasks are under Terminal menu -- Terminal -> Run Task... then you pick what you want. Because we configured this as a BUILD task, it will work with CTRL-B by default.

[Image: SCR-20250903-plyv.png]

I HIGHLY RECOMMEND the extension, but wanted to give you the simplest instructions possible to get you going.

If you want colors like QB64PE IDE the Dark theme in my theme extension is an option for you:
https://open-vsx.org/extension/grymmjack/qb64pe-theme

To use it install the vsix file you downloaded, then click the gear icon in bottom left, then Themes, color theme - or press CTRL-K CTRL-T then pick it.

Good luck!

.vscode/tasks.json
Code: (Select All)
{
  "tasks": [
    {
        "label": "EXECUTE: Run",
        "dependsOn": "BUILD: Compile",
        "type": "shell",
        "windows": {
            "command": "${fileDirname}\\${fileBasenameNoExtension}.exe",
        },
        "osx": {
            "command": "${fileDirname}/${fileBasenameNoExtension}.run",
        },
        "linux": {
            "command": "${fileDirname}/${fileBasenameNoExtension}.run",
        },
        "presentation": {
            "echo": false,
            "reveal": "always",
            "focus": false,
            "panel": "shared",
            "showReuseMessage": false,
            "clear": false
        },
        "group": {
            "kind": "build",
            "isDefault": true
        }
    },
    {
        "label": "BUILD: Compile",
        "dependsOn": "BUILD: Remove",
        "type": "shell",
        "windows": {
            "command": "${config:qb64pe.compilerPath}",
            "args": [
                "-w",
                "-x",
                "-f:MaxCompilerProcesses=8",
                "${fileDirname}\\${fileBasename}",
                "-o",
                "${fileDirname}\\${fileBasenameNoExtension}.exe"
            ]
        },
        "osx": {
            "command": "${config:qb64pe.compilerPath}",
            "args": [
                "-w",
                "-x",
                "${fileDirname}/${fileBasename}",
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}.run"
            ]
        },
        "linux": {
            "command": "${config:qb64pe.compilerPath}",
            "args": [
                "-w",
                "-x",
                "${fileDirname}/${fileBasename}",
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}.run"
            ]
        },
        "presentation": {
            "reveal": "always",
            "clear": true,
            "panel": "shared",
            "focus": false
        }
    },
    {
        "label": "BUILD: Remove",
        "type": "shell",
        "windows": {
            "command": "del",
            "args": [
                "${fileDirname}\\${fileBasenameNoExtension}.exe"
            ]
        },
        "osx": {
            "command": "rm",
            "args": [
                "-f",
                "${fileDirname}/${fileBasenameNoExtension}.run"
            ]
        },
        "linux": {
            "command": "rm",
            "args": [
                "-f",
                "${fileDirname}/${fileBasenameNoExtension}.run"
            ]
        },
        "presentation": {
            "reveal": "always",
            "panel": "shared",
            "focus": false
        }
  ]
}