-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using the LD LIBRARY PATH to load local libraries does not work on Linux #10957
Comments
NativeLibrary doesn't work either. There are two local libraries, one dependent on the other. This works only if the local library has no dependencies.
---> System.DllNotFoundException: Unable to load shared library 'test.so' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: ./testaa.so: cannot open shared object file: No such file or directory |
Thanks @SourceSkyBoxer for such a detailed explanation. Follow the example above: The problem is that NativeLibrary.Load will fail when file2.so references file1.so. If you put file2.so and file1.so in the root directory, there is no problem |
System.DllNotFoundException: Unable to load shared library '.../unix/file2.so' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: ./file1.so: cannot open shared object file: No such file or directory |
This issue was moved to dotnet/runtime#34711 |
I need to use the local library for cross-platform. Local libraries have different implementations and Put them in different folders.
it work fine in windows just like this:
Environment.SetEnvironmentVariable("PATH", path + ";" + Environment.GetEnvironmentVariable("PATH"));
it's not working in linux just like this:
Environment.SetEnvironmentVariable("LD_LIBRARY_PATH", dir + ":" + Environment.GetEnvironmentVariable("LD_LIBRARY_PATH"));
The text was updated successfully, but these errors were encountered: