From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22321 invoked by alias); 17 Mar 2010 23:48:41 -0000 Received: (qmail 22311 invoked by uid 22791); 17 Mar 2010 23:48:40 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from moutng.kundenserver.de (HELO moutng.kundenserver.de) (212.227.126.171) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 17 Mar 2010 23:48:36 +0000 Received: from [192.168.0.115] (p5B132C39.dip.t-dialin.net [91.19.44.57]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0MXEpx-1O5zT81JHJ-00WLNT; Thu, 18 Mar 2010 00:48:31 +0100 Message-ID: <4BA16A4F.2010507@rdsoftware.de> Date: Thu, 18 Mar 2010 00:50:00 -0000 From: Erik Rull User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.22) Gecko/20090605 SeaMonkey/1.1.17 MIME-Version: 1.0 To: "John (Eljay) Love-Jensen" CC: GCC-help Subject: Re: Transitive Linking fails References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 2010-03/txt/msg00221.txt.bz2 Hi John, John (Eljay) Love-Jensen wrote: > dir1/*.o dir2/libx.a -> dir3/liby.so > > The point to -static is to prefer libx.a rather than libx.so when you ask > for -lx. Well, the linking itself was now fine, but I've got new problems in parts of the software that do not use parts of the library. When I link the .o files directly into the shared object, then I have no problem, the software runs fine then. I've built the lib using $(AR) rcs libx.a obj1.o obj2.o where $(AR) put out "ar" > HTH, > --Eljay > As far as I understood it these two commands should result in the same file: (with the command above) $(LD) (shared object options) libshared.so libx.a obj5.o obj6.o and $(LD) (shared object options) libshared.so obj1.o obj2.o obj5.o obj6.o right or not? If not what must be done to make these two lines behaviour equivalent? or must I take -static -lx? Best regards, Erik