总共需要2步:
1.修改环境变量,把mingw64路径移到conda路径前面。
2.在vscode中按F5弹出来的终端中退出conda环境。
ERROR: Unable to start debugging. Unexpected GDB output from command "-exec-run". During startup program exited with code 0xc0000139.
在创建线程池时,VSCode没法调试。
调试控制台输出错误:ERROR: Unable to start debugging. Unexpected GDB output from command "-exec-run". During startup program exited with code 0xc0000139.
终端不能正常运行程序,尝试多种方法,最后发现是终端默认打开了conda环境导致的,用conda deactivate退出conda环境后就可以正常运行了。
还要修改环境变量,把mingw64移到conda前面去。参考了他的答案,感谢!:Vscode c++打断点调试无效解决 ERROR: Unable to start debugging. Unexpected GDB output from command “-exec-run“-CSDN博客
还需要注意,vscode中按F5会新建一个终端,注意退出conda环境是在新建的这个终端中: