From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19331 invoked by alias); 30 May 2011 04:39:38 -0000 Received: (qmail 19319 invoked by uid 22791); 30 May 2011 04:39:37 -0000 X-SWARE-Spam-Status: No, hits=0.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from mail-qy0-f176.google.com (HELO mail-qy0-f176.google.com) (209.85.216.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 30 May 2011 04:39:13 +0000 Received: by qyk30 with SMTP id 30so2154714qyk.0 for ; Sun, 29 May 2011 21:39:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.194.133 with SMTP id dy5mr3142924qab.237.1306730352942; Sun, 29 May 2011 21:39:12 -0700 (PDT) Received: by 10.224.11.143 with HTTP; Sun, 29 May 2011 21:39:12 -0700 (PDT) In-Reply-To: <4DDBB3D0.5010406@redhat.com> References: <4DDBB3D0.5010406@redhat.com> Date: Mon, 30 May 2011 13:19:00 -0000 Message-ID: Subject: Re: Creating archive file with main From: Ajay Jain To: Nick Clifton Cc: binutils@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2011-05/txt/msg00376.txt.bz2 >> 1) I have a framework which includes a main and multiple 'c' files. I >> need to export this framework to other sub-modules. Could I make an >> archive (.a) which includes the main? > > Yes you can. But when I combine this archive (which now has a main) with another archive and then hope to create an executable out of it, the linker starts cribbing. i.e. gcc 1.a 2.a -o out where 1.a has main complains of undefined references to crt.o What is the missing link?