栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

VS Code配置C++环境 在使用vector时报错:Unable to start debugging. Unexpected GDB output from command

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

VS Code配置C++环境 在使用vector时报错:Unable to start debugging. Unexpected GDB output from command

问题描述:

VS Code配置的c++环境中运行包含vector的程序时,遇到了类似这样的错误:
ERROR: Unable to start debugging. Unexpected GDB output from command “-exec-run”. During startup program exited with code 0xc0000139.

测试代码为:

#include
#include
using namespace std;
int main()
{
    vector prices = {1,2,3,7,9};
    int a = 1;
    a+=9;
    a--;
    cout< 

运行cpp文件报错为:

运行可执行文件出现错误为:
无法定位程序输入点__gxx_personality_sj0于动态链接库

原因分析:

这实际上是库的问题,未找到C++的标准模板库

解决方法和原理参考:
https://stackoverflow.com/questions/69038667/vs-code-gdb-debug-error-unable-to-start-debugging-unexpected-gdb-output-from

https://stackoverflow.com/questions/18668003/the-procedure-entry-point-gxx-personality-v0-could-not-be-located


解决方案:

原理是将库文件直接放在需要执行文件目录下

解决步骤:
①.进入你的mingw64/bin目录下,我的是D:ProgramFilesmingw64bin
②.将libstdc++ -6.dll拷贝到需要执行文件目录下
③.重新运行或调试就可以啦

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/926064.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号