devbox icon indicating copy to clipboard operation
devbox copied to clipboard

libstdc++.so.6 => not found

Open spockfish opened this issue 1 year ago • 1 comments

What happened?

A binary won't run because it can't find libstdc++.so.6.

The FAQ mentions this issue and suggests to run devbox add stdenv.cc.cc.lib But that fails: it can't find that package.

Steps to reproduce

  1. build ccache
  2. try to run ccache
  3. ldd ccache will show the message.

Command

No response

devbox.json

{
  "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.13.0/.schema/devbox.schema.json",
  "packages": [
    "perl@latest",
    "libxcrypt@latest",
    "flex@latest",
    "expat@latest",
    "xxd@latest",
    "rustup@latest",
    "gh@latest",
    "fakeroot@latest",
    "patch@latest",
    "cmake@latest",
    "ncurses5@latest",
    "glibc@latest",
    "stdenv@latest",
    "gcc@latest",
  ],
  "env": {},
  "shell": {
    "init_hook": [
      "echo 'Welcome to devbox!' > /dev/null",
      "export NIX_CFLAGS_COMPILE=\"$NIX_CFLAGS_COMPILE -Wno-error=format-security\"", // disable hardening (which does not work for BR)
    ],
    "scripts": {
      "test": [
        "echo \"Error: no test specified\" && exit 1",
      ],
    },
  },
}

Devbox version

0.13.5

Nix version

nix (Nix) 2.24.7

What system does this bug occur on?

Linux (x86-64)

Debug logs

No response

spockfish avatar Oct 18 '24 18:10 spockfish

try adding stdenv_32bit

truearken avatar Oct 19 '24 09:10 truearken

I've encountered this in the past and my resolution was to add 'gccXXStdEnv.cc.cc.lib' as a "package". 'XX' is the gcc version you're using (ie. gcc13StdEnv.cc.cc.lib). Additionally, I augmented the "env" to contain

"LD_LIBRARY_PATH": "$DEVBOX_PROJECT_ROOT/.devbox/nix/profile/default/lib"

Bee-Mar avatar Nov 01 '24 22:11 Bee-Mar