I am a Linux noob trying to compile a 32 bit program and run it on 64bit Ubuntu. It compiles fine but when I run it I get this error: error while loading shared libraries: libm.so.6: cannot stat shared object: Error 38

I have searched for libm.so.6 and found it in /lib32 and /libx32. Any help is appreciated.

  • How did you compile the program? what is the result of ldd prog (where prog is replaced by the name of the compiled executable program)? – steeldriver Jan 18 '19 at 12:59
  • ldd cr2hdr gives "not a dynamic executable" – Bryan Phillips Jan 18 '19 at 18:52
  • I have tried compiling a simple "Hello, world" program. I used this to compile: gcc -m32 hello.c ; When I run ldd a.out I get this result: "not a dynamic executable". If I remove the "-m32" option it works. I am trying to compile a much more complex program to 32bit binary and have reduced the problem to the most simple example. The program requires a 32bit binary. – Bryan Phillips Jan 18 '19 at 19:06
  • Actually the binary hello.c needs is libc.so.6 but it is basically the same problem. – Bryan Phillips Jan 18 '19 at 19:17
  • Is the gcc-multilib package (and its dependencies) installed? – steeldriver Jan 18 '19 at 19:29

I have found the reason but no solution. The reason is that the environment I am using has no 32bit support in the kernel. The environment is UserLAnd running on Android. The developers confirmed there is no 32bit support.

Thanks to everyone for the help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.