2

I have downloaded and extracted the Linux binary for the blackbox PDDL planner, and I'm trying to get the blackbox file to execute. I changed to the directory with the file and tried ./blackbox, which gave me a permissions error. No big deal, just run chmod 755 blackbox to give it executable permissions. But then, when I try ./blackbox again, I get the following error:

bash: ./blackbox: No such file or directory

It does the same when I give the command arguments. When I run ls -l though, I see the blackbox file and it has -rwxr-xr-x permissions, so I'm not sure why it's "losing" the file.

I'm running Ubuntu 14.04 as a dual boot with Windows 7, if that matters.

EDIT: I found a helpful question over on Superuser, which has gotten me partially there. I ran readelf -l ./blackbox | grep ld-linux to find what I needed, then did a package content search to find out I needed the libc6-i386 package. Now I can do the following:

user@ubuntu:~/path$ ./blackbox 
./blackbox: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
user@ubuntu:~/path$ ldd blackbox 
    linux-gate.so.1 =>  (0xf77af000)
    libstdc++.so.6 => not found
    libm.so.6 => /lib32/libm.so.6 (0xf774f000)
    libgcc_s.so.1 => not found
    libc.so.6 => /lib32/libc.so.6 (0xf75a4000)
    /lib/ld-linux.so.2 (0xf77b0000)
wlyles
  • 141
  • 1
    Is your system 32 bit or 64 bit? what is the output of commands file blackbox and ldd blackbox? – steeldriver Apr 23 '15 at 15:47
  • Looks like a 64 bit system. file blackbox tells me that the executable is 32 bit, and ldd blackbox gives the message not a dynamic executable – wlyles Apr 23 '15 at 17:34
  • @steeldriver I've solved part of the problem. Now I get output from ldd, which I've posted in an edit to the question – wlyles Apr 23 '15 at 18:10

1 Answers1

1

Turns out the blackbox executable was a 32-bit program, and I am running a 64-bit OS. Here's the (somewhat hacky) steps I took to resolve this issue (partially chronicled in this question on Superuser):

  • uname -m told me I have a 64-bit OS, but file blackbox told me that this exe was 32-bit.
  • ldd blackbox (strangely) told me that the file was not a dynamic executable, even though I also saw this from file. Trying readelf -l ./blackbox | grep ld-linux told me [Requesting program interpreter: /lib/ld-linux.so.2], which was a shared library that I didn't have at that location.
  • sudo apt-get install libc6-i386 to get that library file (found that with a package search on packages.ubuntu.com).
  • Now ldd gave me output, and I was missing libstdc++.so.6 and libgcc_s.so.1 (see my edit), so I needed to get these files.
  • After a bit more pacakage searching, I found that the gcc-snapshot package had the two files I was missing. This is probably a massive hammer for my tiny nail, and there are likely better solutions, but sudo apt-get install gcc-snapshot got me the files I needed.
  • After running ldd again, this resolved the issue with libgcc_s.so.1, but libstdc++.so.6 was still not found. I ended up going to the place where ldd found libgcc_s.so.1 and running sudo ln -s /usr/lib/gcc-snapshot/lib32/libstdc++.so.6 libstdc++.so.6 to get a symlink to the recently installed file.
wlyles
  • 141
  • 3
    A less hacky solution would probably be to enable i386 multiarch using sudo dpkg --add-architecture i386, then update your repositories sudo apt-get update after which you could have explicitly installed the libc6:i386 and libstdc++6:i386 packages in the normal way – steeldriver Apr 23 '15 at 20:31