Skip to content
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

NixOS error: libstdc++.so.6: cannot open shared object file: No such file or directory #110

Closed
Faless opened this issue Jun 29, 2023 · 0 comments · Fixed by #109
Closed

Comments

@Faless
Copy link
Collaborator

Faless commented Jun 29, 2023

There is an issue on NixOS with the libstdc++.so

This is what it does on startup for me.

Editing project: /home/julian/repositories/godot-demo-projects/networking/webrtc_minimal
ERROR: Can't open dynamic library: /home/julian/repositories/godot-demo-projects/networking/webrtc_minimal/webrtc/lib/libwebrtc_native.linux.template_debug.x86_64.so. Error: libstdc++.so.6: cannot open shared object file: No such file or directory
   at: open_dynamic_library (drivers/unix/os_unix.cpp:447)
ERROR: GDExtension dynamic library not found: /home/julian/repositories/godot-demo-projects/networking/webrtc_minimal/webrtc/lib/libwebrtc_native.linux.template_debug.x86_64.so
   at: open_library (core/extension/gdextension.cpp:400)
ERROR: Failed loading resource: res://webrtc/webrtc.gdextension. Make sure resources have been imported by opening the project in the editor at least once.
   at: _load (core/io/resource_loader.cpp:222)
ERROR: Error loading extension: res://webrtc/webrtc.gdextension

(Why is it taking the debug library and not the release version? Does this mean my version of Godot has been compiled as a debug, so this is the compatible one?)

I hacked it so it worked by following @MatthewCroughan's method above:

$ nix build github:nixos/nixpkgs/nixos-unstable#gcc-unwrapped.lib

$ readlink -f result-lib/lib64/libstdc++.so.6
/nix/store/v286z87irid5vn13y2z6fphfrzmgj0kf-gcc-12.3.0-lib/lib/libstdc++.so.6.0.30

$ patchelf --replace-needed libstdc++.so.6 /nix/store/v286z87irid5vn13y2z6fphfrzmgj0kf-gcc-12.3.0-lib/lib/libstdc++.so.6.0.30 ./libwebrtc_native.linux.template_debug.x86_64.so

$ ldd libwebrtc_native.linux.template_debug.x86_64.so
linux-vdso.so.1 (0x00007ffc346fb000)
	/nix/store/v286z87irid5vn13y2z6fphfrzmgj0kf-gcc-12.3.0-lib/lib/libstdc++.so.6.0.30 (0x00007ffa3caa4000)
	libm.so.6 => /nix/store/yaz7pyf0ah88g2v505l38n0f3wg2vzdj-glibc-2.37-8/lib/libm.so.6 (0x00007ffa3c9c4000)
	libgcc_s.so.1 => /nix/store/0fvh2p4irz0lw0cpy2ll1rf2hbhbym3g-xgcc-12.2.0-libgcc/lib/libgcc_s.so.1 (0x00007ffa3c9a3000)
	libc.so.6 => /nix/store/yaz7pyf0ah88g2v505l38n0f3wg2vzdj-glibc-2.37-8/lib/libc.so.6 (0x00007ffa3c7bd000)
	/nix/store/yaz7pyf0ah88g2v505l38n0f3wg2vzdj-glibc-2.37-8/lib64/ld-linux-x86-64.so.2 (0x00007ffa3d54f000)

Now it works, but just for me.

Originally posted by @goatchurchprime in #44 (comment)

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant