プログラミングを始めて3週間のものです。
C++をclang++でデバックするときにエラーが出ます。
コンパイラーはclang++,デバッガーはlldbを使用しています。
エラーコードは
Warning: Debuggee TargetArchitecture not detected, assuming x86_64. ERROR: Unable to start debugging. Unexpected LLDB output from command "-exec-run". process exited with status -1 (attach failed ((os/kern) invalid argument)) The program '/Users/Username/Desktop/c++_language/c++_language1' has exited with code 42 (0x0000002a).
下記が task.json ファイルです
task.json
// See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ { "type": "shell", "label": "clang++ build active file", "command": "/usr/bin/clang++", "args": [ "-std=c++17", "-stdlib=libc++", "-g", "${file}", "-o", "${fileDirname}/${fileBasenameNoExtension}" ], "options": { "cwd": "${fileDirname}" }, "problemMatcher": ["$gcc"], "group": { "kind": "build", "isDefault": true } } ] }
下記が launch.jsonファイルです
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": "clang++ - Build and debug active file", "type": "cppdbg", "request": "launch", "program": "${fileDirname}/${fileBasenameNoExtension}", "args": [], "stopAtEntry": true, "cwd": "${workspaceFolder}", "environment": [], "externalConsole": false, "MIMode": "lldb", "preLaunchTask": "clang++ build active file" } ] }
PCは
macOSBig Sur 11.6 Apple M1 です。
まだ回答がついていません
会員登録して回答してみよう