3

I just downloaded AC3D and extracted the zip in a folder in my home folder. I opened a terminal, CD'd to the folder and typed ./ac3d. But I get the following error message every time:

bash: ./ac3d: No such file or directory

But the file is clearly there! I already made it runable so that couldn't be the case either. Any help would be appreciated!

Thanks in advance!

Edit 1: @TheSchwa I did. And it shows up so yes, it does get recognized.

@Nephente Here you go. Output of ls -l ac3d is:

-rwxrwxrwx 1 ruben ruben 3758400 mei  1 23:34 ac3d

Output of head -1 ac3d is (abbreviated)

ELF@�   4�T94(44�4�44�4���o27o27@7����|_h�7h0h088HH�H�  P�td\�4\(\(PPQ�td/lib/ld-linux.so.2GNU �[...]

Edit 2:

Output of dpkg --print-architecture: amd64

Output of dpkg --print-foreign-architectures: i386

11
  • 1
    Try entering the extracted folder, typing ./ and then <tab> twice to see if it's recognized.
    – TheSchwa
    Sep 23, 2015 at 8:24
  • 2
    Please change to the directory and append the output of ls -l ac3d, and if the file really exists head -1 ac3d to your question. Do not put the output in a comment, but please edit your question.
    – Nephente
    Sep 23, 2015 at 8:24
  • I suspect, the problem is that you're running a 64bit Ubuntu without support for 32bit applications, which this binary is. Could you append the outputs of dpkg --print-architecture and dpkg --print-foreign-architectures
    – Nephente
    Sep 23, 2015 at 10:05
  • Done that. Outputs are in EDIT2 Sep 23, 2015 at 15:36
  • Please add the download location of the zip
    – A.B.
    Sep 23, 2015 at 15:44

1 Answer 1

3

The problem is, that the binary is a 32bit executable and you're running a 64bit Ubuntu. That is not a problem, since Ubuntu offers support for multiple architectures.

If in doubt about the nature of an executable, or any file in general, the command

file <filename>

offers valuable information. If the command is not available, it can be installed through

sudo apt-get install file

In this case, it tells us among other information

ac3d: ELF 32-bit LSB executable[...]
interpreter /lib/ld-linux.so.2

The interpreter is the bit of software responsible for loading all the shared libraries a binary needs to run. If it's missing, an application cannot run.

32- and 64bit executables need different interpreters and different versions of shared libraries. Fortunately Ubuntu (or more precisely Debian) introduced very sophisticated multi-architecture support some time ago[cit. needed]

To make sure the package system is prepared for another architecture, one can view the systems default architecture with

dpkg --print-architecture

On a 64bit Ubuntu this will default to amd64.

dpkg --print-foreign-architectures

prints out all other architectures the package system is aware of. For 32bit support, the output must contain i386. If it does not, one can add support with

sudo dpkg --add-architecture i386

It is necessary to update the package list afterwards

sudo apt-get update

The necessary libraries or packages in their i386 flavor can now be installed with

sudo apt-get install <package>:i386

More specifically, to install the needed interpreter, the installation of the GNU C Shared Library is indicated:

sudo apt-get install libc6:i386

This will in many cases make the binary in question execute, but of course there are many libraries an application can be dynamically linked against, that is depend on. These need to be installed in the same fashion. If a library is missing, the linker will give an error at execution

./ac3d: error while loading shared libraries: libGLU.so.1: \
cannot open shared object file: No such file or directory

At this point one needs to find, which package contains this missing file. If the corresponding package in the native architecture is already installed, one can search vi adpkg

dpkg -S libGLU.so.1
libglu1-mesa:amd64: /usr/lib/x86_64-linux-gnu/libGLU.so.1

So we would need to install libglu1-mesa:i386. Repeat until all dependencies are satisfied.

But often a library is completely missing from the system. In that case, one can either search Ubuntu's online package database, or install the utility apt-file and do

apt-file search <filename> 

A very nice HOWTO on multi-arch support on Debian (same holds for Ubuntu) can be found here.

Extra: The package binutils contains some pretty nifty tools to examine binaries. In particular it contains the ldd (List Dynamic Dependencies) util. It lists all the dynamic libraries a binary needs to run.

Example:

ldd ac3d

produces

linux-gate.so.1 (0xf77b7000)
libfreetype.so.6 => /usr/lib/i386-linux-gnu/libfreetype.so.6 (0xf76ee000)
libGLU.so.1 => not found
libGL.so.1 => not found
libpng12.so.0 => /lib/i386-linux-gnu/libpng12.so.0 (0xf76c0000)
libXmu.so.6 => not found
libXext.so.6 => not found
libX11.so.6 => not found
libdl.so.2 => /lib/i386-linux-gnu/i686/cmov/libdl.so.2 (0xf76ba000)
libpthread.so.0 => /lib/i386-linux-gnu/i686/cmov/libpthread.so.0 (0xf769e000)
libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xf75ac000)
libm.so.6 => /lib/i386-linux-gnu/i686/cmov/libm.so.6 (0xf7566000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xf7549000)
libc.so.6 => /lib/i386-linux-gnu/i686/cmov/libc.so.6 (0xf739e000)
libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xf7381000)
/lib/ld-linux.so.2 (0xf77ba000)

This way one can find out quickly which libraries are missing from the system.

2
  • @TheBoneJarmer You're very welcome. Btw. you also think my answer is well written and potentially helpful to others, you can also upvote it, in addition to accepting it. But that is of course entirely up to you ;-)
    – Nephente
    Sep 23, 2015 at 17:40
  • Done that! Nice job! But you know what still bothers me? I got it up and running with your help after almost 2 hours but just take a look what was required to do so. While for the same thing in Windows you just doubleclick the shortcut and be done with it. Besides that, the error message I got at first was confusing because it simply wasn't correct. I do not know if I can send a feedback item or anything to Ubuntu's developers because things like this just shouldn't happen. Sep 23, 2015 at 17:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .