0

I have run gcc cross compiler from ubuntu(x86) to arm. this cross compiler works fine on ubuntu 14, and not I try in on ubuntu 18.

I tried to compile simple program

#include <stdio.h>
void main() {
    printf("h\n");
}

gcc test.c -o test 

When I compile it with gcc (to x86) all works fine, but when I compile it with cross compiler arm gcc I got error ...arm-buildroot-linux-uclibcgnueabu/4.*.*/cc1 : error while loading shared libraries: libmpfr.so.4 cannot open shared object file: No such file or directory

When I serach I can findlibmpfr.so.4 in the cross compiler path under /usr/lib

So even arm-gcc test.c -o test -L "<path_to_compiler>/usr/lib" got same error . and even export LD_LIBRARY_PATH=<path_to_compiler>/usr/lib didn't help

parser1234
  • 111
  • 1
  • 7
  • Can't imagine this will fix it but did you try and pass in the library directory explicitly? – jiveturkey Apr 28 '20 at 13:25
  • @jiveturkey yes, I update my post – parser1234 Apr 28 '20 at 13:32
  • Where did you get the ARM toolchain from? Did you build it on your own? How has that compiler been configured, ie what's the output of `arm-gcc -v`? – emacs drives me nuts Apr 28 '20 at 14:37
  • `arm-gcc test.c -o test /usr/lib/libmpfr.so.4` should work – whoopdedoo Apr 28 '20 at 15:52
  • Does this answer your question? [cannot open libmpfr.so.4 after update on ubuntu 18.04](https://stackoverflow.com/questions/51288467/cannot-open-libmpfr-so-4-after-update-on-ubuntu-18-04) – whoopdedoo Apr 28 '20 at 15:54
  • @Jim West `arm-gcc test.c -o test /usr/lib/libmpfr.so.4` got same error – parser1234 Apr 30 '20 at 04:20
  • @emacs drives me nuts yes, I have build this toolchain by own , version is 4.9 – parser1234 Apr 30 '20 at 04:21
  • @parser1234 In that case I'd recommend you read the installation instructions again, in particular how to get the prerequisites (GMP, MPFR, MPC,...) right by using `./contrib/download_prerequisites`. In the case you configured in the source directory (which is not supported btw) get the sources again and stick to the documentation. – emacs drives me nuts Apr 30 '20 at 08:35

0 Answers0