I used the g++ -static link option and am getting some odd results. My question is, does -static interfere with the dynamic linking of shared libraries other than the one that I specify on the command line?
The details: my original compilation command was this:
Code:
g++ -o mav <...snip...> -lm -lgfortran
The specified library libgfortran.a is not available on our system, but libgfortran.so.1 is. I replaced the "-lgfortran" as follows, hoping that I could link statically with only libgfortran.so.1 and not affect linking with any other shared library:
Code:
g++ -o mav <...snip...> -lm -static /usr/lib/libgfortran.so.1
The code compiles and links without any error messages, but when I run "mav", I get this error:
bash: ./mav: /usr/lib/libc.so.1: bad ELF interpreter: No such file or directory
Did my use of the -static option prevent the linker from finding libc.so.1 and/or any other shared libraries?