question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to load shared library 'gdal_wrap' or one of its dependencies

See original GitHub issue

I run MaxRev.Gdal.Core + MaxRev.Gdal.LinuxRuntime.Minimal on CentOS 7 with simple code:

return new string[] {
   "GDAL Version: " + Gdal.VersionInfo("RELEASE_NAME"),
   "GDAL INFO: " + Gdal.VersionInfo("")
};

This code throws an error:

An unhandled exception has occurred while executing the request. System.TypeInitializationException: The type initializer for ‘OSGeo.GDAL.GdalPINVOKE’ threw an exception. —> System.TypeInitializationException: The type initializer for ‘SWIGExceptionHelper’ threw an exception. —> System.DllNotFoundException: Unable to load shared library ‘gdal_wrap’ or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libgdal_wrap: cannot open shared object file: No such file or directory

The same code work smoothly on Windows

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
KubaSzostakcommented, Jan 13, 2023

You can use older version of the package. For example 3.1.2.110 will work with Ubuntu 18.04. But I agree with @MaxRev-Dev, upgrading Ubuntu would be a wise decision. Not only because of maintenance end. Ubuntu 22.04 has great improvement on caching file reading. Take a look at picture bellow. The same code executed on two VMs. On the left is Ubuntu 18.04 and on the right Ubuntu 22.04. Whatever data you want to utilize using MaxRev.Gdal library you will get performance boost by upgrading to Ubuntu 22.04.

afs-ubuntu-dotnet-performance

0reactions
MaxRev-Devcommented, Jan 12, 2023

@BaiC Ubuntu18.04 support window is until April 30, 2023 EOL.

After much thought, I decided to stay on Debian 11. There are several reasons why.

  • GDAL requires SWIG 4. There is no RPM package, but of course, It can be installed with some additional efforts on older systems.
  • Some packages failed to install on CentOS7 (boost deps, deprecated rpm packages). This will require additional investigation time and is difficult to maintain independently.
  • CentOS will receive updates only for one year (until June 30, 2024). Then we will have to find another LTS distro.
  • Most Microsoft base images are built on top of Debian 11.
  • You receive a newer GLIBC 2.31 (2020).
  • Most systems that use GLIBC lower than 2.31 are out of support or will be soon.

You have several options:

  • Use a Dockerized version of your app (sample)
  • Use a newer environment if you can (Debian 11, Ubuntu 20.04).
Read more comments on GitHub >

github_iconTop Results From Across the Web

Exception while using GDAL in C# - Stack Overflow
The error you are receiving re gdal_wrap.dll is referring to one of its dependencies. I threw that DLL into depends and it found...
Read more >
How do I install the GDAL bindings for C#/.NET 4.5.1?
I'm trying to use the C# gdal bindings but I get an error in my C# code which says "Unable to load DLL...
Read more >
GDAL Installation Issues
Theses error messages imply that one of our core libraries, GDAL or HDF5, failed to initialize their necessary libraries. This is most likely...
Read more >
Problem loading raster package on Rstudio server ...
I do have an issue loading the 'raster' package. The error message: library(raster) Error: package or namespace load failed for 'raster' in dyn....
Read more >
Importing GDAL from Nuget Package
I am attempting to import GDAL into Unity. I am using the GDAL library within my own custom class library, which is compiled...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found