I fixed this issue by making a change in 'launch.json' file. I changed the value of "cwd" below "name": "(gdb) Launch eds" in "configurations" field. I set it to the absolute path of the folder containing the project. Below is my launch.json file. I'm using VS Code on Ubuntu.
{
// 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 eds",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build_x86_debug/bin/fcc",
"args": ["-a=${workspaceFolder}/build_x86_debug/bin/", "-d=${workspaceFolder}/build_x86_debug/bin/", "-c=${workspaceFolder}/build_x86_debug/bin/"],
"stopAtEntry": false,
"cwd": "/home/aiden/dev2",
"environment": [{"name": "LD_LIBRARY_PATH", "value": "/usr/lib:${workspaceFolder}/build_x86_debug/bin:${workspaceFolder}/pocolib1.7.5"}],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
{
"name": "Launch",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/build_x86/bin/emvadapter",
"cwd" : "/home/vendor",
"env" : { "LD_LIBRARY_PATH":"/home/vendor/lib" }
},
{
"name": "Unit Tests",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/build_x86/bin/",
"linux": { "cwd": "${workspaceFolder}/vendor"}
}
]
}