microsoft / microsoft/vscode-cpptools
Cannot debug wxWidgets in VSC in Mac
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
Type: Debugger
Describe the bug
- OS and Version: 10.15.4
- VS Code Version: 1.44.2
- C/C++ Extension Version: 0.27.0
- A clear and concise description of what the bug is.
I have a project that uses wxWidgets and if I buil it using cmake and make the resulting objects works as expected when called from the terminal.
Nevertheless, if I debug it from VCS I get:
As can be seen the headers from wxWidget are not detected as well:

It basically says that cannot open those header files.
My CMakeFile.txt include the directory to wx where all the header files are located:
cmake_minimum_required(VERSION 3.11.3)
set(CMAKE_CXX_STANDARD 17)
project(Membot)
find_package(wxWidgets REQUIRED COMPONENTS core base)
include(${wxWidgets_USE_FILE})
file(GLOB project_SRCS src/*.cpp)
add_executable(membot ${project_SRCS})
target_link_libraries(membot ${wxWidgets_LIBRARIES})
target_include_directories(membot PRIVATE "/usr/local/opt/wxmac/include/wx-3.0")
So I do not understand where the error is.
My launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "clang++ - Compilar y depurar el archivo activo",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/membot",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "lldb"
//"preLaunchTask": "clang++ build active file"
}
]
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with launch.json and CMakeFile.txt, comparing the VS Code debugger configuration with the terminal-built executable and its wxWidgets include paths. Reproduce the launch using the stated macOS, VS Code, and C/C++ extension versions. Done means the debugger opens the wxWidgets headers and runs the CMake-built membot executable as expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp, vscode
- Domain
- build-system, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100