Missing Glibc dependencies 2.35 and 3.4.30

We’re attempting to use the EmguCV in a dotnet 6.x project and have loaded the following two nuget packages (Emgu.CV 4.6.0.5131 and Emgu.CV.runtime.ubuntu-x64 4.6.0.5131).

We’re getting the following exception when attempting to access this libraries functions:

System.TypeInitializationException: The type initializer for 'Emgu.CV.CvInvoke' threw an exception.
 ---> System.DllNotFoundException: Unable to load shared library 'cvextern' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libcvextern: cannot open shared object file: No such file or directory

Checking the ‘libcvextern.so’ dependencies we find that it requires two versions of glibc: 1) GLIBC_2.35 and 2) GLIBCXX_3.4.30.

ldd   ~/.nuget/packages/emgu.cv.runtime.ubuntu-x64/4.6.0.5131/runtimes/ubuntu-x64/native/libcvextern.so 

/home/talos/.nuget/packages/emgu.cv.runtime.ubuntu-x64/4.6.0.5131/runtimes/ubuntu-x64/native/libcvextern.so: /nix/store/v6szn6fczjbn54h7y40aj7qjijq7j6dc-glibc-2.34-210/lib/libm.so.6: version `GLIBC_2.35' not found (required by /home/talos/.nuget/packages/emgu.cv.runtime.ubuntu-x64/4.6.0.5131/runtimes/ubuntu-x64/native/libcvextern.so)
/home/talos/.nuget/packages/emgu.cv.runtime.ubuntu-x64/4.6.0.5131/runtimes/ubuntu-x64/native/libcvextern.so: /nix/store/8mhaj6yvvb7rq0kl5xmg6wl9myxvs804-gcc-11.3.0-lib/lib/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /home/talos/.nuget/packages/emgu.cv.runtime.ubuntu-x64/4.6.0.5131/runtimes/ubuntu-x64/native/libcvextern.so)

We’ve done some digging around for these versions of the glibc library using ‘nixos search’ but have come up short.

How can we resolve these dependencies? What packages should we be including?

Thanks.

Current NixOS unstable ships glibc 2.35, but NixOS stable 22.05 doesn’t and will likely never do so due to our stability guarantees. Thus, it seems that you’ll need to depend on the unstable channel for glibc (or wait for 22.11).

1 Like

Thanks for the feedback.

I was not aware of these dependency issues nor the implications they infer. I’ve decided to take another approach and attempted to load OpenCvSharp4 (4.6.0.20220608) plus OpenCvSharp4.runtime.ubuntu.18.04-x64 (4.6.0.20220608), however, I’m running into several other dependencies that I can’t seem to locate.

 	libcairo.so.2 => not found
	libgdk_pixbuf-2.0.so.0 => not found
	libdc1394.so.22 => not found
	libavcodec.so.57 => not found
	libavformat.so.57 => not found
	libavutil.so.55 => not found
	libswscale.so.4 => not found
	libjpeg.so.8 => not found
	libpng16.so.16 => not found
	libIlmImf-2_2.so.22 => not found

Of course, this mix of packages is also not idea, I’d prefer official nixos 22.05 support – but that will take a effort, and I was hoping to vet this approach before investing any additional effort.

I was able to track down and fix several of the required libraries, but have come up short on those listed above.

I’ve also loaded nix-index and found that several packages reference those listed above, but can’t quite figure out the exact dependencies to pull in to address these issues.

Thoughts?