ev3dev / vscode-ev3dev-browser

Visual Studio Code extension for browsing ev3dev devices
https://marketplace.visualstudio.com/items?itemName=ev3dev.ev3dev-browser
MIT License
36 stars 11 forks source link

Problems with environment variables #89

Closed Private0xCC closed 4 years ago

Private0xCC commented 4 years ago

The environment variables of F5 running the program on ev3 are inconsistent with those of SSH terminal, resulting in the program not being able to load the Shared library properly. The error message after F5 is as follows:

Starting: brickrun --directory="/home/robot/HelloWorld/bin/Release" "/home/robot/HelloWorld/bin/Release/HelloWorld"
Started.
----------
/home/robot/HelloWorld/bin/Release/HelloWorld: error while loading shared libraries: libev3dev.so: cannot open shared object file: No such file or directory
----------
Exited with error code 127.

LD_LIBRARY_PATH is already set in ~/.profile, and make sure libev3dev.so exists. Running the program through an SSH terminal is no problem. I've compared the environment variables in both ways,They're not the same。

dlech commented 4 years ago

As a workaround, you can use the ev3devBrowser.env setting for this extension. For example, add something like this to .vscode/settings.json.

{
    "ev3devBrowser.env": {
        "LD_LIBRARY_PATH": "/home/robot/libev3dev"
    }
}
Private0xCC commented 4 years ago

As a workaround, you can use the ev3devBrowser.env setting for this extension. For example, add something like this to .vscode/settings.json.

{
    "ev3devBrowser.env": {
        "LD_LIBRARY_PATH": "/home/robot/libev3dev"
    }
}

Thank you very much,The perfect solution