I ve used VS Code for Arduino and not had any issues. But now I m trying to start a C++ project of my own, and the setup is a little weird for me.
My environment:
VS Code running on Win10
configured to remote debug on a headless raspberry pi
在所附的民主选举学会形象中,我把这一问题分为三个县。
- Compile, but doesn t include the linker commands and so fails to link.
- Same as 1, but then launches the debugger and complains that the file is out of date
- Compiles, links and launches the debugger and runs the code
In Arduino I used buttons 1 & 2, so I m not sure why it s different now.
这里是我的任务。 json, 我补充说,三部输血管连线指挥部。
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: g++ build active file",
"command": "/usr/bin/g++",
"args": [
"-fdiagnostics-color=always",
"-g",
"${fileiii",
"-o",
"${fileDirnameiii/${fileBasenameNoExtensioniii",
"-lpigpio",
"-lrt",
"-lpthread",
""
],
"options": {
"cwd": "${fileDirnameiii"
iii,
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
iii,
"detail": "Task generated by Debugger."
iii
],
"version": "2.0.0"
iii
当我点击button1以进行汇编时,这是所执行的指挥(没有连线指挥):
Executing task: /bin/bash -c g++ -Wall -Wextra -Wpedantic -Wshadow -Wformat=2 -Wcast-align
-Wconversion -Wsign-conversion -Wnull-dereference -g3 -O0 -c
/home/aaronl/lawnmower/src/lawnmower.cpp -o ./build/Debug/lawnmower.o &&
g++ -Wall -Wextra -Wpedantic -Wshadow -Wformat=2 -Wcast-align -Wconversion -Wsign-conversion -Wnull-dereference -g3 -O0 ./build/Debug/lawnmower.o -o ./build/Debug/outDebug
当我点击button3时,这是所执行的指挥(有线人指挥):
Starting build...
/usr/bin/g++ -fdiagnostics-color=always -g /home/aaronl/lawnmower/src/lawnmower.cpp -o
/home/aaronl/lawnmower/src/lawnmower -lpigpio -lrt -lpthread
我失踪了什么? 为什么用 but子来做这项工作。 json file? 是否有不同的“json”档案,应当加以编辑?
www.un.org/Depts/DGACM/index_spanish.htm 请求清单:
C:Usersaaron>code --list-extensions
franneck94.c-cpp-runner
ms-vscode-remote.remote-ssh
ms-vscode-remote.remote-ssh-edit
ms-vscode.cpptools
ms-vscode.remote-explorer
platformio.platformio-ide
vadimcn.vscode-lldb