Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
288 views
in Technique[技术] by (71.8m points)

c - Can't run program in external terminal on VS Code on mac OS

I can't run my C programs on VS Code in an external Terminal. I use mac OS, I got installed C/C++ extension and code runner. Clicking F5, the terminal window pops up but the program doesn't run in it.

Here is a screenshot of how it looks like

Here are my .json settings:

launch.json

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [

    {
        "name": "(lldb) Launch",
        "type": "cppdbg",
        "request": "launch",
        "program": "${fileDirname}/${fileBasenameNoExtension}",
        "args": [],
        "stopAtEntry": false,
        "cwd": "${workspaceFolder}",
        "environment": [],
        "externalConsole": true,
        "MIMode": "lldb"
    }
]

}

settings.json

{
"files.associations": {
    "__locale": "c"
}

}

tasks.json

{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
    {
        "label": "build",
        "type": "shell",
        "command": "msbuild",
        "args": [
            // Ask msbuild to generate full paths for file names.
            "/property:GenerateFullPaths=true",
            "/t:build",
            // Do not generate summary otherwise it leads to duplicate errors in Problems panel
            "/consoleloggerparameters:NoSummary"
        ],
        "group": "build",
        "presentation": {
            // Reveal the output only if unrecognized errors occur.
            "reveal": "silent"
        },
        // Use the standard MS compiler pattern to detect errors, warnings and infos
        "problemMatcher": "$msCompile"
    }
]

}

Anyone has an idea on what should I change? Please help :(

question from:https://stackoverflow.com/questions/65672000/cant-run-program-in-external-terminal-on-vs-code-on-mac-os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...