のねのBlog

パソコンの問題や、ソフトウェアの開発で起きた問題など書いていきます。よろしくお願いします^^。

error: could not find `Cargo.toml` in FOLDER or any parent directory ターミナルの処理が終了しました (終了コード: 1)

  • preLaunchTask 'Rust: cargo build' が終了コード1で終了しました。とメッセージが表示された。 "cargo build”するときのフォルダ位置が違うようです。 デバッグの方は、フォルダ位置があってるので、そのまま、動きました。

VSCodeで、別のフォルダ位置を開きなおしたら、動くようになった。

  • ”このままデバッグを続ける”をクリックすると、デバッグにはいった。
configuration: {
  type: 'lldb',
  request: 'launch',
  name: 'Debug',
  program: '${workspaceFolder}/<your program>',
  args: [],
  cwd: '${workspaceFolder}',
  relativePathBase: 'c:\\Users\\m_fuj\\Documents\\GitHub\\rustbook\\ch02'
}
Listening on port 50963
[2019-11-18T01:05:22Z ERROR codelldb::debug_session] Internal debugger error: unable to find executable for 'C:\Users\m_fuj\Documents\GitHub\rustbook\ch02\<your program>.exe'
[2019-11-18T01:05:22Z ERROR codelldb::debug_session] Stream::poll after shutdown
Debug adapter exit code=0, signal=null.
{
    // IntelliSense を使用して利用可能な属性を学べます。
    // 既存の属性の説明をホバーして表示します。
    // 詳細情報は次を確認してください: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(Windows) 起動",
            "type": "cppvsdbg",
            "request": "launch",
            "program": "${workspaceFolder}/rpn/target/debug/rpn.exe",
            "args": [],
            //preLaunchTaskを追加する
            "preLaunchTask": "Rust: cargo build",
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false
        }
    ]
}