opencv-rust icon indicating copy to clipboard operation
opencv-rust copied to clipboard

add method of resolve VSCode rust-analyzer dyld not load problem to troubleshoot

Open CrazyChildren opened this issue 1 year ago • 1 comments

when using VSCode rust-analyzer plugin(which is recommended for using vscode), it would report "dyld not loaded".because it will NOT load DYLD_FALLBACK_LIBRARY_PATH environment variable. you should open setting->rust-analyzer->server->env variables or open setting.json file of vscode and put this:

"rust-analyzer.server.extraEnv": {
        "DYLD_FALLBACK_LIBRARY_PATH": "<your fallback path>",
        "LDFLAGS": "-L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib",
        "LD_LIBRARY_PATH": "${LD_LIBRARY_PATH}:/usr/local/lib"
    }

or you can just use rust-cover developed by jetBrains

CrazyChildren avatar Jul 19 '24 04:07 CrazyChildren

got the same issue in zed editor, fixed with configurations as follows in .zed/settings.json { "lsp": { "rust-analyzer.server.extraEnv": { "DYLD_FALLBACK_LIBRARY_PATH": "/Library/Developer/CommandLineTools/usr/lib", "LDFLAGS": "-L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib", "LD_LIBRARY_PATH": "/usr/local/lib" } } }

benmooo avatar Sep 18 '24 09:09 benmooo

Thank you for the configs! I'm going to add the link to this issue in the troubleshooting section for further reference.

twistedfall avatar Nov 12 '24 20:11 twistedfall