I'm using VSCode to create a C++ project and keep getting this error when trying to build && debug. When running from console if I use 'g++ -o main 'main.cpp' 'file_1.cpp' 'file_2.cpp'' it works and compiles correctly.
我读到这是与文件的链接有关的问题?有没有人知道如何在VSCode中解决这个问题?我有一个默认的 launch.json 配置文件,可以建立活动文件,如果这有帮助的话。
下面是我的tasks.json文件的内容。
"version": "2.0.0", "tasks": [ "type": "shell", "label": "shell: g++ build active file", "command": "/usr/bin/g++", "args": [ "-g", "${file}", "-o", "${fileDirname}/${fileBasenameNoExtension}" "options": { "cwd": "/usr/bin" "problemMatcher": [ "$gcc" "group": { "kind": "build", "isDefault": true "type": "shell", "label": "g++ build active file", "command": "/usr/bin/g++", "args": [ "-g", "${file}", "-o", "${fileDirname}/${fileBasenameNoExtension}" "options": { "cwd": "/usr/bin"编辑:我在使用Debian 10 'Buster'。