Could not load source: SourceRequest not supported

  bazel, c++, visual-studio-code

I’m trying to run the debugger in VSCode using Bazel on a C++ application on MacOS 11. When I try to run this, I get the error message : "Could not load source ‘testcpp.cc’: ‘SourceRequest’ not supported". I’m not sure what I need to do to resolve this…it compiles and debugs properly on the command line. Here is my BUILD file:

package(
    default_visibility = ["//visibility:public"],
)

cc_binary(
    name="testcpp",
    srcs=["testcpp.cc"],
)

Here is my .vscode/tasks.json file:

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "test dummy app",
            "type": "shell",
            "command": "bazel build -c dbg --strip=never --spawn_strategy=standalone :testcpp"
        },
    ]
}

And here is my .vscode/launch.json file:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(lldb) Launch",
            "type": "cppdbg",
            "preLaunchTask": "test dummy app",
            "request": "launch",
            "program": "${workspaceFolder}/bazel-bin/testcpp",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "lldb"
        }
    ]
}

Any help would be appreciated. Thanks!

Source: Windows Questions C++

LEAVE A COMMENT