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

Building multiples files in VSCode and WSL and C++

$
0
0

I have tested to code multiple files on vscode with WSL by doing

code .

in the good folder.

I have three files.

And here is the error message I obtain, whereas the code is correct :

g++: error: helloworld.cpp: No such file or directory

g++: error: file2.cpp: No such file or directory g++: error: file3.cpp: No such file or directory

g++: fatal error: no input files

compilation terminated.

The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

And here is my tasks.json file :

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "shell",
            "label": "g++ build active file",
            "command": "/usr/bin/g++",
            "args": [
                "-g",
                "helloworld.cpp","file2.cpp","file3.cpp",
                "-o",
                "executable.out"
            ],
            "options": {
                "cwd": "/usr/bin"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}

Please, could you help to solve that issue whereas with a single file as mentioned here, that perfectly works :

https://code.visualstudio.com/docs/cpp/config-wsl#_modifying-tasksjson

I also precise that the .cpp files are not in the .vscode folder, but in the main folder of the project.

Thanks in advance

ps : I saw several threads about that issue, but that did not solve my issue.


Viewing all articles
Browse latest Browse all 97420

Trending Articles



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