Hi! I’ve spent a lot of time setting up my nix system and everything was almost working (after many battles) until I’ve run into this when setting up my dev environment:
internal:/nix/store/s5sd5dwk615m1gwk72i7rd40n40znscd-ruby-3.1.4/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb:37:in require': /nix/store/9fy9zzhf613xp0c3jsjxbjq6yp8afrsv-gcc-12.3.0-lib/lib/libstdc++.so.6: version GLIBCXX_3.4.32’ not found (required by /nix/store/5laiqnyngxgm00vjhhd4drymbnhv3sph-libheif-1.15.2/lib/libheif.so.1) - /nix/store/sahkja71y8m6ycqjhg6ifblh0l4wdwb7-ruby3.1-rmagick-5.3.0/lib/ruby/gems/3.1.0/gems/rmagick-5.3.0/lib/RMagick2.so (LoadError)
I have installed both ruby and rmagic with devbox, so they are both nix packages. Both installed, byt rmagik fails at runtime (opening a rails console will do that). Any idea of what I might try next?
I’m having a similar problem when trying to install python packages. GLIBCXX_3.4.32 not found.
It looks like stdenv.cc.cc.lib uses gcc-12.3.0 which only provides GLIBCXX is 3.4.30. I’m not sure how to get nix to use a more recent version of gcc. (Latest version is currently 14.1.1)
Same here, except when trying to install the recently released nodejs_22
$ npm --version
/nix/store/...-nodejs-22.0.0/bin/node: /nix/store/...-gcc-12.3.0-lib/lib/libstdc++.so.6: version `GLIBCXX_3.4.32' not found (required by /nix/store/...-nodejs-22.0.0/bin/node)
I think it’s worth explaining about how LD_LIBRARY_PATH being set relates to “GLIBCXX_ not found”.
On Linux, programs linked against shared libraries are run with the dynamic linker. This is similar to how running ./foo.sh uses the shebang #!/usr/bin/env bash to run/interpret the file.
The man page for ld-linux points out that it uses the LD_LIBRARY_PATH to indicate where to look for shared libraries.
On NixOS, a dynamic linker has a path like /nix/store/35pq4hr29c3sl79lgfwgsvd9nwzyp4am-glibc-2.39-5/lib64/ld-linux-x86-64.so.2.
So, setting LD_LIBRARY_PATH helps when e.g. using Python packages with pre-compiled shared binaries, since it helps Python find those shared libraries.
But, setting it globally also means that all programs are going to pick up the same version of glibc (or other libraries on LD_LIBRARY_PATH). Programs packaged with Nix (if packaged correctly) should be able to find the shared libraries they depend on without LD_LIBRARY_PATH being set. And apparently can fail with LD_LIBRARY_PATH set to include incompatible versions of libraries they’re linked against.
E2024-05-27 10:48:19.811578 addonloader.cpp:38] Failed to load library for addon bamboo on /nix/store/0n2b8b27i3hjq6zg422c5g1a6mhqzwx1-fcitx5-with-addons-5.1.5/lib/fcitx5/libbamboo.so. Error: /nix/store/hc0jij4wmrcdrad7fd381r4x2j12d550-gcc-12.3.0-lib/lib/libstdc++.so.6: version `GLIBCXX_3.4.32' not found (required by /nix/store/0n2b8b27i3hjq6zg422c5g1a6mhqzwx1-fcitx5-with-addons-5.1.5/lib/fcitx5/libbamboo.so)
What should i do? unset LD_LIBRARY_PATH in terminal and run fcitx there didnt work
I didnt set LD_LIBRARY_PATH but it seems to point to pipewire jack
Reformatting the error you provided so that it’s easier to read:
E2024-05-27 10:48:19.811578 addonloader.cpp:38]
Failed to load library for addon bamboo on
/nix/store/0n2b....zwx1-fcitx5-with-addons-5.1.5/lib/fcitx5/libbamboo.so.
Error: /nix/store/hc0ji....d550-gcc-12.3.0-lib/lib/libstdc++.so.6:
version `GLIBCXX_3.4.32' not found
(required by /nix/store/0n2b....zwx1-fcitx5-with-addons-5.1.5/lib/fcitx5/libbamboo.so)
How did you build the fcitx5-with-addons, and what code did you use for the fcitx-bamboo addon?
Okay, so it seems that GLIBCXX_3.4.32 is found in gcc13 not 12. I tried running a shell with gcc13 and launch fcitx5 from there, it linked the 12 version still. Might the problem be that I use stable channel for the system and unstable pkgs for bamboo?
/nix/store/c28gplkk35ziwqb8fgnv7609b9i0haym-ruby-3.3.0/lib/ruby/3.3.0/bundled_gems.rb:74:in `require': /nix/store/dghjv6hfz0s0z4kffa5ahyw2mhp79215-gcc-12.3.0-lib/lib/libstdc++.so.6: version `GLIBCXX_3.4.32' not found (required by /nix/store/1ki1ndr6ql3ij0avqdpym0nw7k7lbnjz-proj-9.4.1/lib/libproj.so.25) - /nix/store/bp71h96qrmngnlmxmcqf3c9awvmdj831-ruby3.3-rgeo-proj4-4.0.0/lib/ruby/gems/3.3.0/gems/rgeo-proj4-4.0.0/lib/rgeo/coord_sys/proj4_c_impl.so
Note that I have no LD_LIBRARY_PATH set.
Any idea why it would be looking for GLIBCXX_3.4.32 in gcc-12 intead of 13?
When I do an ldd on libproj.so.25 it shows: