将其他SO Lib搜索路径添加到调试器

时间:2018-08-20 10:29:26

标签: c++ debugging visual-studio-code

您好,我正在尝试将VScode上的调试器用于c ++项目。

代码使用外部共享库(.so),该共享库不在操作系统(linux)usr / lib上。共享库位于项目的存储库中。

我尝试在launch.json文件上使用AdditionalSOLibSearchPath,但没有成功。

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(gdb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/Build/Debug/Progname",
            "additionalSOLibSearchPath": "${workspaceFolder}/ExternalLibs/include/;${workspaceFolder}/ExternalLibs/static",
            "args": [],
            "stopAtEntry": true,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": true,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        }
    ]
}

我还尝试制作完整路径,并直接指向.so文件,但它不起作用。

"additionalSOLibSearchPath": "${workspaceFolder}/ExternalLibs/static/libwebsockets.so.5.0.0;${workspaceFolder}/ExternalLibs/static/libwebsockets.so",

"additionalSOLibSearchPath": "/home/username/projects/repos/projectgitfolder/ExternalLibs/static/libwebsockets.so.5.0.0;/home/username/projects/repos/projectgitfolder/ExternalLibs/static/libwebsockets.so",

我设法通过运行.so文件夹中的程序来使其工作 “ cwd”:“ $ {workspaceFolder} / ExternalLibs / static”, 这样,我在exec文件旁边运行.so库的程序。但是我认为这不是使其工作的最佳方法。

有人知道我在做什么错吗?

谢谢

0 个答案:

没有答案