gpt4 book ai didi

c++ - 由于共享库事件而停止 - Visual Studio Code

转载 作者:塔克拉玛干 更新时间:2023-11-03 07:41:58 25 4
gpt4 key购买 nike

我是 Visual Studio Code 的初学者,我尝试在其上 Dedug 我的 C++ 代码。我这里有一个示例代码:

#include "iostream"    
using namespace std;

int main() {
cout << "hello world";
return 0;
}

我设置我的 launch.json 如下:

{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/hello",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}

当我运行调试时,Visual Studio Code 显示如下错误:

Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
=cmd-param-changed,param="pagination",value="off"
Stopped due to shared library event (no libraries added or removed)
Loaded '/lib64/ld-linux-x86-64.so.2'. Symbols loaded.

Breakpoint 1, 0x000000000040077a in main ()
[Inferior 1 (process 4504) exited normally]
The program '/media/sf_E_DRIVE/Downloads/radixSA/test_vsc/hello' has exited with code 0 (0x00000000).

我从谷歌搜索这个错误,一些帖子说这是关于“共享库事件”的问题。我怎样才能忽略那个错误?

最佳答案

here复制粘贴:

假设 launch.json"additionalSOLibSearchPath" 选项没有帮助,以下设置可能将共享库添加到 gdb的考虑:

"setupCommands":[
{
"description": "Additional libs for gdb",
"text": "set solib-search-path sharedLibraryPath/lib"
}
]

PS:gdb 可能仍会发出 Stopped due to shared library event (no libraries added or removed) 警告,尽管如此。

关于c++ - 由于共享库事件而停止 - Visual Studio Code,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48071176/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com