microsoft / microsoft/vscode-cpptools

[Linux] Cannot Pass Environment Variable To Debug Session

Offen
#3,189 5 Kommentare 1 Reaktion 1 zugewiesene Person Auf GitHub ansehen

@WardenGnaw arbeitet bereits daran.

Seit 20.2.2019.

debugger
Vorherrschende Sprache
TypeScript
Sterne
6.2k
Forks
1.7k
Ø Merge
14 Std. 46 Min.
Gemergte PRs (30 T.)
61

Beschreibung

Describe the bug

  • OS and Version: Linux
  • VS Code Version: 1.31.0
  • C/C++ Extension Version: 0.22.0
  • Other extensions you installed (and if the issue persists after disabling them): None
  • A clear and concise description of what the bug is.

I am attempting to debug an application that has to link to some custom DLL's.

The application needs the proper path set in the LD_LIBRARY_PATH environment variable.

When I launch the application in debug mode, I receive the following output.

&"warning: GDB: Failed to set controlling terminal: Operation not permitted\n"
/home/myuser/git/myworkspace/bin/debug/Linux/3.10.0/x86_64/myprogram: error while loading shared libraries: mySharedLib.so: cannot open shared object file: No such file or directory

The problem is simple, I just need to get the debug session to have the proper environment variable setup prior to launching my application.

In my launch.json file, I have external console set to FALSE. When I echo the LD_LIBRARY_PATH variable from this terminal it has the correct path. If I launch my program from here (non debug mode) it works fine.

I have tried the following settings in launch.json...

"args": ["${env:LD_LIBRARY_PATH}"],

"environment": [ { "name": "LD_LIBRARY_PATH", "value": "/mypath/to/lib/" } ]

"setupCommands": 
[{ 
     "description": "Additional libs",
     "text": "set env LD_LIBRARY_PATH =/mypath/to/lib/",
}],

"additionalSOLibSearchPath" : "/mypath/to/lib/"

But I continue to receive the same error where it cannot find my libs. This seems like something trivial and should work. Anyone else with this issue?

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.