From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21220 invoked by alias); 7 Aug 2012 06:46:29 -0000 Received: (qmail 21211 invoked by uid 22791); 7 Aug 2012 06:46:28 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-yw0-f47.google.com (HELO mail-yw0-f47.google.com) (209.85.213.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 07 Aug 2012 06:46:09 +0000 Received: by yhjj56 with SMTP id j56so3376883yhj.20 for ; Mon, 06 Aug 2012 23:46:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.149.225 with SMTP id ud1mr7576393igb.74.1344321968681; Mon, 06 Aug 2012 23:46:08 -0700 (PDT) Received: by 10.64.176.239 with HTTP; Mon, 6 Aug 2012 23:46:08 -0700 (PDT) Date: Tue, 07 Aug 2012 06:46:00 -0000 Message-ID: Subject: libgfortran.a and libgfortran.so From: benzhi cao To: gcc-help@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2012-08/txt/msg00040.txt.bz2 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': Hope anyone can help me ,thanks in advance~ Best~