Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 99093

Compilling C++ in visual studio code on Ubuntu

$
0
0

I'm trying to compile a very simple code. I put in tasks.json configuration copied from here.

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "build & debug file",
      "type": "shell",
      "command": "g++",
      "args": [
        "-g",
        "-o",
        "${fileBasenameNoExtension}",
        "${file}"
      ],
      "group": {
        "kind": "build",
        "isDefault": true
      }
    },
    {
      "label": "build & run file",
      "type": "shell",
      "command": "g++",
      "args": [
        "-o",
        "${fileBasenameNoExtension}",
        "${file}"
      ],
      "group": {
        "kind": "build",
        "isDefault": true
      }
    }
  ]
}

But when I build (ctrl+shift+b) I get errors:

usr/bin/ld:/home/username/LinuxProjects/FirstCppProject/.vscode/tasks.json: file format not recognized; treating as linker script /usr/bin/ld:/home/username/LinuxProjects/FirstCppProject/.vscode/tasks.json:1: syntax error collect2: error: ld returned 1 exit status The terminal process terminated with exit code: 1

I don't understand what's wrong with the json.


Viewing all articles
Browse latest Browse all 99093

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>