This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

libgfortran.so and libgfortra.a statically link program


Hi,
    recently I use the gcc 4.4 to  compile  fortran programs.and then
I use ld to link these programs .But the ELF I get is a dynamic link
file.However I want to link these files statically for the reason that
I want the VirtAdd of LOAD to be determined in an ELF,so I use the
-Bstatic -lgfortran. But some problems occurs,and it means that some
libraries cannot be found.So I see the files in the gcc directory. I
find there is a libgfortran.a and libgfortran.so as well.And I know
the former is a static library and the latter is a shared library.But
what is the difference between them and how can I just use the
libgfortran.a to link the fortran programs.
    The  follows is the errors when i use the -Bstatic -lgfortran:
/usr/lib/gcc/x86_64-linux-gnu/4.4//libgfortran.a(compile_options.o):
In function `_gfortran_set_options':
(.text+0x165): undefined reference to `signal'
/usr/lib/gcc/x86_64-linux-gnu/4.4//libgfortran.a(compile_options.o):
In function `_gfortran_set_options':
(.text+0x174): undefined reference to `signal'
/usr/lib/gcc/x86_64-linux-gnu/4.4//libgfortran.a(compile_options.o):
In function `_gfortran_set_options':
(.text+0x183): undefined reference to `signal'
/usr/lib/gcc/x86_64-linux-gnu/4.4//libgfortran.a(compile_options.o):
In function `_gfortran_set_options':
     So I am wondering what is the difference between libgfortran.so
and libgortran.a except that the former is a dynamic library and the
latter is a static library,does libgfortran.so contains any functions
that libgfortran.a don't include? I am a newer ,and thanks for your
help in advance~
    Hope anyone can help me ,thankyou so much~
Best~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]