Why doesn't gcc work with the “unrecognized command line option” -L / lusr / opt / mpfr-2.4.2 / lib? '?

My sysadmin recently installed a new version of GCC in / lusr / opt / gcc -4.4.3. I tested it as follows:

mike@canon:~$ cat test.c
int main(){
  return 0;
}
mike@canon:~$ gcc test.c
/lusr/opt/gcc-4.4.3/libexec/gcc/i686-pc-linux-gnu/4.4.3/cc1: error while loading shared libraries: libmpfr.so.1: cannot open shared object file: No such file or directory

After I reported this to the administrator, he added /lusr/opt/mpfr-2.4.2/lib:/lusr/opt/gmp-4.3.2/libto mine LD_LIBRARY_PATH. After that, I get the following error:

mike@canon:~$ gcc test.c
cc1: error: unrecognized command line option "-L/lusr/opt/mpfr-2.4.2/lib"

Firstly, my system administrator was not completely sure that this was the best workaround (although he said that it worked for him ...), is there a better solution?

Secondly, why am I getting a linker error from ccand how to fix it?

Some information that may be helpful:

mike@canon:~$ env | grep mpfr
OLDPWD=/lusr/opt/mpfr-2.4.2/lib
LD_LIBRARY_PATH=/lusr/opt/mpfr-2.4.2/lib:/lusr/opt/gmp-4.3.2/lib:

mike@canon:~$ echo $LDFLAGS

(the above is a blank line)
+3
2

, GMP MPFR . ( MPC.) GCC - 4.5.2, (AFAIK) - , GMP MPFR .

LD_LIBRARY_PATH GCC. , , , . .

, , , :

gcc -v test.c

. -L ( ), 1.

+1

- gs ( -L foo).

LD_LIBRARY_PATH=\ /lusr/opt/mpfr-2.4.2/lib:/lusr/opt/gmp-4.3.2/lib

mpfr ?

0

Source: https://habr.com/ru/post/1732474/


All Articles