From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10957 invoked by alias); 14 Mar 2009 20:49:04 -0000 Received: (qmail 10947 invoked by uid 22791); 14 Mar 2009 20:49:04 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_82 X-Spam-Check-By: sourceware.org Received: from smtp.salomon.at (HELO sauxb.salomon.at) (193.186.16.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 14 Mar 2009 20:48:57 +0000 Received: from servex01.wamas.com (servex01.salomon.at [172.28.2.2]) by sauxb.salomon.at (8.12.10/8.12.10) with ESMTP id n2EKmUCe023356; Sat, 14 Mar 2009 21:48:32 +0100 (MET) Received: from [172.28.50.37] ([172.28.50.37]) by servex01.wamas.com with Microsoft SMTPSVC(6.0.3790.3959); Sat, 14 Mar 2009 21:48:30 +0100 Subject: Re: Statically linked shared library From: Michael Haubenwallner To: Kolesar Cc: gcc-help@gcc.gnu.org In-Reply-To: <22478672.post@talk.nabble.com> References: <22478672.post@talk.nabble.com> Content-Type: text/plain Date: Sat, 14 Mar 2009 20:49:00 -0000 Message-Id: <1237063708.10660.18.camel@salomon-22> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Info: -3.079 () ALL_TRUSTED,AWL,BAYES_00 X-IsSubscribed: yes 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: 2009-03/txt/msg00160.txt.bz2 On Thu, 2009-03-12 at 08:39 -0700, Kolesar wrote: > Hi All > > I try linked shared library, statically, but i get error. Where I made > mistake? Please help. > > Exactly, I want dynamically linked -ldl -lrt -luuid -lm -ldl, and statically > linked -ldrmod (libdrmod.so) As far as I can tell, statically linking a shared library does not work for example on Linux, Solaris, HP-UX, Windows. The only platform I know of being able to do that is AIX. > g++ -static -ldl -lrt -luuid -lm -ldl -o > /home/asimh/my_program/src/.bin/sysnfop1s.so > -L/home/asimh/my_program/lib/.bin -ldrmod > > /usr/bin/ld: cannot find -ldrmod When switched to static linking, the linker does not search for your libdrmod.so, but libdrmod.a only (even on AIX), which simply does not exist. HTH, /haubi/