GLIBC incompatiable problem

I tried to compile the three-d crate but failed.

The error message says that it requires a certain version of GLIBC:

/nix/store/q29bwjibv9gi9n86203s38n0577w09sx-glibc-2.33-117/lib/libc.so.6: version `GLIBC_2.34' not found

(yes, my os is nixos, which does not have the fhs by default).

I have tried both the stable and nightly channel toolchains, neither works.

I wonder if I can build the rust toolchain from the source by using rustup to solve this problem?

Have you tried installing glibc 2.34? You can make a separate NiX environment (or whatever .nix files represent) to try it out.

I have not tried yet. I notice that glibc has been upgraded to 2.34 in the nixpkgs main branch. So maybe I can try a few days later.

It doesn't seems like a compile error. Did you run it on the same machine it compiled?

This error appears when I run cargo build --example fog, so I think it IS a compilation error.

It probably happens when running a build script then. Try cargo clean and rebuilding. There may be something wrong in the build cache. I tend to get this kind of errors when letting rust-analyzer (which runs cargo check and thus builds build scripts) run in the vscode flatpak which has a newer glibc than my host system and then trying to build on the host system as cargo wants to rerun a build script, but it is compiled for the newer glibc version. cargo clean allows the build script to be recompiled for the older glibc version.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.