How can I use Visual Studio Code for debugging MATLAB MEX-files or Simulink S-Functions compiled with MingW64 on Windows or GCC/G++ on Linux?

Can I use Visual Studio Code to debug my MinGW64 MEX-files? And can I use it on Linux to debug my GCC MEX-files?

 Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 20 de Mzo. de 2026 a las 0:00
Editada: MathWorks Support Team el 20 de Mzo. de 2026 a las 16:52
Yes, you can use Visual Studio Code for debugging MinGW64 and GCC MEX-files. See How can I use Visual Studio Code to debug my MinGW C/C++ file? for a downloadable Visual Studio Code example project and up-to-date information on debugging with newer releases. The debugging workflow in that article should work with gcc/gdb on Linux machines.

2 comentarios

Is there an update? The old method doesn't work now
We are aware of an issue when debugging with newer releases (for example, VS Code 1.92.2 and R2024a). VS Code does not halt at the set breakpoints, and the breakpoints are not confirmed to be set by VS Code and show "Attempting to bind the breakpoint..."
This appears to be an issue on VS Code's side and has been reported already:

Iniciar sesión para comentar.

Más respuestas (0)

Productos

Versión

R2017a

Preguntada:

el 20 de Jun. de 2018

Editada:

el 20 de Mzo. de 2026 a las 16:52

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by